Fork this repo and clone
- Install react-router and react-router-dom
npm install react-router-dom
- In index.js
import { BrowserRouter } from "react-router-dom";
- Wrap the App component with BrowserRouter.
- In App.js,
import { Route, Routes } from "react-router-dom";
- wrap each compoenent with Route and add exact paths to each one
- warp all components with Routes.
- test if everyting is working well
- create a NavBar component
import { Link } from "react-router-dom";
- add Links to redirect you to other components in the app (list, home)
- add Details component to your App.js and wrap it in Route
- the path for this Detail component has to have an id as a param
- in ProductItem component wrap the image with a link to take you to the detail component, you should send the id in the path
- in detail component get the id from the params and find the cookie using its id
- add a logo to your app in the Navbar and place it in the top left
- clicking on the logo should always redirect you to home !
Right now, your browser tab title is not changing. Make it so that all your pages have a title. HINT: use React Helmet.