What is React router DOM:-
You can create a Webpage in React but without installing the react-router your site won’t function as a single page application, For this purpose we need a (React Router DOM). The primary functionality of React-Router-Dom is implementing dynamic routing in web applications.
sTEPS TO INSTALL REACT ROUTER:-
- Go to the Respective Code editor that you are using and type the following command in the terminal = ( npm install react-router-dom@6 )
- After installing the package, check the PACKAGE.JSON file to check the router Version installed.
- The next step is to import the BrowserRouter in APP.JS file or INDEX.JS file:- [ import { BrowserRouter } from “react-router-dom”; ]
- Now, we need to write every code inside the <BrowserRouter> Tag on the APP.JS file.
5. You must also keep in mind to import the Browser Router, Routes, and Route in the APP.JS file.
6. . After following all the above steps you can create a React webpage that will function without reloading the page.
<————————————————————————————–>