February 2019
Intermediate to advanced
204 pages
4h 52m
English
Let's build our components. We'll start by breaking our component down into the main component, the ToDo list component, the AddTodo component, and the Footer component. The code must be self-explanatory.
App.js is the main container component that gets the TODO states and passes them to the required components. We use the Redux connect function to connect our container and components. This should make sense, having read Chapter 1, Understanding Redux. Let's examine our Todo.js file, as follows:
//Todo.jsimport React, { PureComponent } from "react";import PropTypes from "prop-types";import { deleteTodo, completeTodo } from "../actions/todos";import cn from "classnames";export default class Todo extends PureComponent { static propTypes ...Read now
Unlock full access