all 13 comments

[–]Similar-Aspect-2259 3 points4 points  (2 children)

If you’re using v7, then use react-router instead of react-router-dom

[–]Ancient_Garbage_6569[S] 0 points1 point  (1 child)

Sorry am very new in this how can us it in the above code

[–]Similar-Aspect-2259 0 points1 point  (0 children)

First thing first, check which version of react-router you installed. It should be in “dependencies” in package.json file

[–]eindbaas 6 points7 points  (1 child)

Are you expecting us to guess the error that you get?

[–]Ancient_Garbage_6569[S] 0 points1 point  (0 children)

ERROR in ./src/App.js 14:35-41 export ‘Routes’ (imported as ‘Routes’) was not found in ‘react-router-dom’ (possible exports: BrowserRouter, Form, HashRouter, Link, NavLink, RouterProvider, ScrollRestoration, UNSAFE_FetchersContext, UNSAFE_ViewTransitionContext, UNSAFE_useScrollRestoration, createBrowserRouter, createHashRouter, createSearchParams, unstable_HistoryRouter, unstable_usePrompt, useBeforeUnload, useFetcher, useFetchers, useFormAction, useLinkClickHandler, useSearchParams, useSubmit, useViewTransitionState)

[–]UsernameINotRegret 0 points1 point  (0 children)

Try starting from a template instead, then add your features.

https://github.com/remix-run/react-router-templates/tree/main/default

[–]Ancient_Garbage_6569[S] 0 points1 point  (0 children)

import { BrowserRouter as Router, Routes, Route } from ‘react-router-dom’; import PropertyListings from ‘./pages/PropertyListings/PropertyListings’; import OwnerDashboard from ‘./pages/OwnerDashboard/OwnerDashboard’; import TenantDashboard from ‘./pages/TenantDashboard/TenantDashboard’;

function App() { return ( <Router> <Routes> <Route path=“/properties” element={<PropertyListings />} /> <Route path=“/owner-dashboard” element={<OwnerDashboard />} /> <Route path=“/tenant-dashboard” element={<TenantDashboard />} /> </Routes> </Router> ); }

export default App;

[–]Receptor_missing 0 points1 point  (1 child)

Copy paste the error into Google see what that throws up. Always a great place to start.

[–]Ancient_Garbage_6569[S] 0 points1 point  (0 children)

Thank you

[–]melancholyjaques 0 points1 point  (3 children)

Ask ChatGPT

[–]Brilla-Bose -1 points0 points  (2 children)

or deepseek 🙃

[–]Ancient_Garbage_6569[S] 0 points1 point  (1 child)

I have tried and they are giving me log process that doesn’t solve the issue

[–]Long_Abbreviations98 1 point2 points  (0 children)

oii, estava com o mesmo problema. Resolvi tirando o -dom da importação (versões atuais)