React Cheatsheet

INSTALLATION
React <script src="https://unpkg.com/react@15/dist/react.js"></script>$ $ npm install react --save$ $ bower install react --save

React DOM

<script src="https://unpkg.com/react-dom@15/dist/react-dom.js"></script>$ npm install react-dom$ bower install react-dom --save
RENDERING
ES5 ReactDOM.render( React.createElement( Link, {href: 'https://Node.University'} ) ), document.getElementById('menu'))

ES5+JSX

ReactDOM.render( <Link href='https://Node.University'/>, document.getElementById('menu'))

Server-side rendering

const ReactDOMServer = require('react-dom/server')ReactDOMServer.renderToString(Link, {href: 'https://Node.University'})ReactDOMServer.renderToStaticMarkup(Link, {href:'https://Node.University'}) ...

Get React Quickly: Painless web apps with React, JSX, Redux, and GraphQL now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.