SIGNIFICANCE OF REACT ROUTER DOM


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:-
  1. Go to the Respective Code editor that you are using and type the following command in the terminal = ( npm install react-router-dom@6 )
  2. After installing the package, check the PACKAGE.JSON file to check the router Version installed.
  3. The next step is to import the BrowserRouter in APP.JS file or INDEX.JS file:- [ import { BrowserRouter } from “react-router-dom”; ]
  4. 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.

<————————————————————————————–>


Leave a Reply

Your email address will not be published. Required fields are marked *