April 2018
Intermediate to advanced
284 pages
6h 43m
English
React is based on a modular build with encapsulated components that manage their own state, so it will efficiently update and render your components when data changes. In React, a component's logic is written in JavaScript instead of templates, so you can easily pass rich data through your app and manage the state out of the DOM. Using the render() method, we are rendering a component in React that takes input data and returns what you want to display. It can either take HTML tags (strings) or React components (classes). Let's take a quick look at examples of both:
var myReactElement = <div className="hello" />;ReactDOM.render(myReactElement, document.getElementById('example'));
In this example, we are passing HTML as a string ...