A React app to practice React Router v6
Here is a working live demo tech-news-react-router
In this project, I practice using React Router to add client-side routing to a React Application.
The objective is to add client-side routing to the application using React Router so that:
- Install
react-router-domand add it to a React application. - Enable routing by using
RouterProviderand providing arouter. - Creating a router using
createBrowserRouter(). - Use
createRoutesFromElements()to configure a router. - Use the
Routecomponent to add static and dynamic routes to an application. - Use
LinkandNavLinkcomponents to add links to an application. - Access the values of URL parameters using React Router’s
useParamshook. - Create nested routes using
Route,Outlet, and relativepaths. - Declaratively redirect users by rendering React Router’s
Navigatecomponent - Imperatively redirect users via the
useNavigatehook. - Access and set the value of query parameters using React Router’s
useSearchParamshook.
- React 18
- React Router 6
To run this project, install it locally using npm:
$ cd ../[directory]
$ npm install
$ npm start
