react render component according to path name code example Example: route in component react import { BrowserRouter, Route, Link } from "react-router-dom";