Todo list – implementing ComponentWillMount

In this recipe, you will learn about the lifecycle methods in React. We will see how the information flows through the methods since the component is pre-mounted, mounted, and unmounted. The Todo list that we will develop in this recipe will look like this:

  1. For this Todo list, we need to create a new folder called Todo into our components directory, and you also need to create files called Todo.js and Todo.css. This is the skeleton of the Todo component:
import React, { Component } from 'react';import './Todo.css';class Todo extends Component {  constructor() {    super();  }  componentWillMount() { ...

Get React Cookbook now with O’Reilly online learning.

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