The React component life cycle for mounting

We need to understand the React component life cycle for mounting components as well, since we'll need to hook into that later as part of hooking everything back up to our application. There are two main categories of phases when dealing with React components. The first is the Render Phase, where React is concerned about how the initial component is created and rendered to the page. You should keep these clean and without side-effects, so, as an example, we would not include any calls to our backend to fill in data or components on the page. The functions that are most commonly used here are constructor() and render().

The second phase, however, is the phase where we can modify things after the fact. The main function to mention here is componentDidMount(), which is where we can (and will) fire off requests to our backend server. The diagram for these calls might look something like this:

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset