React Router and Authentication
To use react router in react js first we have to import react router. 1 import {createBrowserRouter} from "react-router-dom". 2 import routerProvider which is a contextapi built by react which takes router. 3 Create a constant router which contains the routes which is in an object. 4 The route consists of two parts; path and element where path is the location of the element and element is the component to be route. Eg: const router = createBrowserRouter ([ { path : "/" , element : < Homepage /> , }, { path : "/profilePage" , element : < ProfilePage /> , }, { path : "/profiles" , element : < Profiles /> , }, ]); 5 Then we import Link to link the component route by using the path declared in constant router. Eg; < Link to = "/" ...