How to do it…

We will create a component where we will sum all the numbers entered in an input. We can take some of the last recipes to start from there:

  1. The first thing we will do is to modify our App.js and include the Numbers component:
    import React, { Component } from 'react';    import Numbers from './Numbers/Numbers';    import Header from '../shared/components/layout/Header';    import Content from '../shared/components/layout/Content';    import Footer from '../shared/components/layout/Footer';    import './App.css';    class App extends Component {      render() {        return (          <div className="App">            <Header title="Understanding Pure Components" />            <Content>              <Numbers />            </Content>            <Footer />          </div>        );      }    }    export default App;
File: src/components/App.js

Get React Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.