Create the Necessary Components of the React App
Learn which components must be implemented to use react-router in an application.
We'll cover the following...
This lesson covers the essential components required to create the contact-list application.
Basic components
Two main components will be rendered in the contact list app. The first is contacts
, which renders the list of contacts, and the second is search
, which implements the search functionality.
Steps to create components
- Create a
components
folder. - Create two files, one for contacts and another for searching, and name them
Contacts.js
andSearch.js
. Add simple, functional components in both, as shown below.
import React from 'react'const Contacts = () => {return (<div>Contacts Component</div>)}export default Contacts
Basic component files
-
Make sure to import both components in the
App.js
file. -
Create a file ...