So far, we have explored React component properties and how we need to initialize, update, and change the component's state(s) for interactive applications. Let's now explore the lifecycle of such a React component in this chapter. We will also dig into future ECMAScript syntax and a few changes that the React community also used from version 0.13.0. For this, we will review some ES6 and ES7 features within the React library.
While creating any React component by calling React.createClass()
, we need to always have a render method. This render method returns a description of the DOM. React has a performance edge in our applications because React maintains a fast in-memory representation of the DOM and never directly interacts with the actual DOM. Thus, when the render method returns the description of the DOM, React can compare the difference between the actual DOM and the in-memory representation, and, based on the difference(s...