Since they're so encapsulated, components make code reuse, testing, and separation of concerns easy. - You can always tell how your component will render by looking at one source file (JSX) - You can render React on the server (Stack overflow is a good example of server-side rendering) - Learn Once, Write Anywhere (*isn’t perfect, but it’s a fact)
computes the resulting differences, and then updates the browser's displayed DOM efficiently. This allows the programmer to write code as if the entire page was rendered on each change while the React libraries only render subcomponents that actually change.
syntax), a JavaScript extension syntax that allows quoting of HTML and using HTML tag syntax to render subcomponents. HTML syntax is processed into JavaScript calls of the React library. Developers may also write in pure JavaScript. JSX is similar to another syntax extension created by Facebook for PHP, XHP.
values, are passed to a component's renderer like properties in its HTML tag. A component cannot directly modify any properties passed to it, but callback functions that modify values can be passed. This mechanism's promise is expressed as "properties flow down; actions flow up". For example, a shopping cart component might include multiple product line components. Rendering a product line uses only the properties passed to it and cannot affect the shopping cart's total due. However, the product line could be passed to a callback function as a property which would be called when a 'delete this product' button was pressed and that callback function could affect the total due.
or Webpack or just use bower https://facebook.github.io/react/docs/package-management.html React 15.3.0 (production) The compressed, production version of react.js and react-dom.js (you need both). <script src="https://npmcdn.com/[email protected]/dist/react.min.js"></script> <script src="https://npmcdn.com/[email protected]/dist/react-dom.min.js"></script> React with Add-Ons 15.3.0 (production) The compressed, production version of React with optional add-ons. https://facebook.github.io/react/docs/addons.html <script src="https://npmcdn.com/[email protected]/dist/react-with-addons.min.js"></script> <script src="https://npmcdn.com/[email protected]/dist/react-dom.min.js"></script> $ bower install --save react