using react component using router code example
Example 1: how to use react router
npm install react-router-dom
Example 2: route in component react
import { BrowserRouter, Route, Link } from "react-router-dom";
npm install react-router-dom
import { BrowserRouter, Route, Link } from "react-router-dom";