Notifications
Clear all
Aug 11, 2022 12:12 pm
The problem is noticed while routing in react. So, how to solve the problem?Â
2 Replies
Aug 11, 2022 12:25 pm
import { Â BrowserRouter, Â Routes, Â Route } from "react-router-dom"; function App() { Â return ( Â <BrowserRouter> Â Â <Routes> Â Â Â <Route path="/" element={<Home />} /> Â Â Â <Route path="/profile/:username" element={<Profile />} /> Â Â Â <Route path="/login" element={<Login />} /> Â Â Â <Route path="/resister" element={<Resister />} /> Â Â Â Â Â Â Â Â </Routes> Â </BrowserRouter>
Please make sure that you are using the latest version of React. And if you are using another code for adding routes then you have to use this code instead of yours. Â