Skip to main content

Posts

Showing posts from April, 2016
Search Interface with React js We’ll place a new index.html file inside the public folder that QEDServer created for us when we started it up. In this file, we place our usual HTML skeleton and a element that will hold our application. We’ll tell React to render its contents into this area of the page. We also import a few libraries in the header section of the page: react/index.html ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​Product Search​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​Waiting…​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ We’re including React, but we’re going to use jQuery for making our Ajax requests. React is purely a UI library; it doesn’t have its own way of fetching data from servers. The third library we’re loading is React’s JSX Transformer. React has its own dialect of JavaScript, called JSX, that makes creating templates easier. Let’s start by creating the outer component. In search.js, we create the initial version of our ProductSearch component: react/search.js ​ ​var​ ProductSearch = React.createCla...