Adding react-router-dom is a piece of cake by now. Just take yarn or npm and add it to your project. Let's get started with our boilerplate code. Copy all of the starter files. We already added react-router-dom to our app in Chapter 3, Routing, and Chapter 4, The Concept of Immutability. If your app does not have react-router-dom, you can add it as follows:
yarn add react-router-dom --exact
OR
npm install react-router-dom
In our health application, we will have the following pages:
Page Description |
Page Component |
Page Routes |
Home page |
HomePage |
/ |
About page |
AboutPage |
/about |
Contact page |
ContactPage |
/contact |
Register page |
RegisterPage |
/register |
Login page |
LoginPage |
/login |
Forget password |
ForgetPassword |
/forget-password |
Reset password |
ResetPassword |
/reset-password |
Dashboard page... |