score:0
only thing i see missing is the routes
component wrapping the route
components. you imported routes
but don't appear to have used it. all route
components must be rendered into a routes
component (or another route
if nesting). without the routes
you should be seeing the error a <route> is only ever to be used as the child of <routes> element, never rendered directly. please wrap your <route> in a <routes>.
<router>
<routes>
<route exact path="/" element={<about />} />
<route exact path="/shop" element={<shop />} />
</routes>
</router>
score:0
check if you have installed react-router-dom version 6. for version 6 you must wrap up all 'route' inside a "routes".
Source: stackoverflow.com
Related Query
- Nothing displays when using React Router
- You should not use Route or withRouter() outside a Router when using react-router 4 and styled-component in react
- How to pass the match when using render in Route component from react router (v4)
- how to pass props to the route when using react router <Link>
- Using render in react router dom with a private route
- Using React Router DOM Route in Material-UI Breadcrumbs
- MobX, React Router v4, Route using render function not observing and re-rendering when store changes
- CSS not changing when using React Router to route to another component
- Convert from react router dom v5 to react router dom v6 when using useRouteMatch
- React Router : Data fetched using axios doesn't save when navigating to new route
- External link not working when using LINK from react router dom
- Display URL params on page when using react `withRouter` from react router dom
- I cant use framer motion when using <navigate/> react router dom v6 to auth my login page
- React Router Dom how to redirect to Other App.js route when you are in any subRoute of any route
- React Router render error when using Link inside the Route element
- Conditionally set active class on menu using react router current route
- React router doesn't route traffic when hosted on firebase
- ReactJS - Handle POST requests using react router dom
- If condition to change route using React Router V4
- React: Stop click event propagation when using mixed React and DOM events
- React router nested routes - How to redirect when no route is matching
- How do you pass data when using the navigate function in react router v6
- How to scroll to top on route change with react router dom v6?
- React router is not reloading page when url matches the same route
- How can I match if the current route matches a pattern in React Router Dom v6?
- react router app hosted on firebase issues 404 error only when trying to access route via address bar
- Using condition for redirecting in react router dom v6
- React set state/props on route using react router
- How to detect route changes using React Router in React?
- Show Sidebar Navigation only at Home using React Router Dom
More Query from same tag
- the problem: the code below work flawlessly in dev but after uploaded to Heroku it's working sometimes,
- Updating parent component state from child component
- Can I use matchPath without a child component?
- Input styling is off using MaterialUI
- Fetch request stops working if I change route
- How to add class to li tag in react-slick
- getSnapshotBeforeUpdate using react hooks
- .babelrc being hidden in in MacOS Mojave update causing build fail
- How to set a base path to react?
- Sending response of multiple api calls from action to view file in react js with redux
- Why is the content removed after page refresh?
- Props changes arenot reflected on component UI although the new state is shown in console in React/Redux
- how to show label between two nodes in react?
- how sort columns in ascending and descending order?
- MobX running a function after async action
- React router modal-only routes
- Open a browser in Electron
- Go JS Tree view equivalent in React
- How is it that binding a method inside the constructor is different from binding it inside the call to React.cloneElement?
- How to redirect login page to dashboard using ReactJS?
- React-Redux - TypeError: state.menu is not iterable
- state not updating in child component - react js
- Retrieve env variables in Strapi plugin
- What is wrong with syntax of this react render function?
- How to change the tip text of getFieldDecorator dynamically?
- react with redux and react-router dispatches action twice
- How to change colour of disabled button in styles.js
- Using async/await inside a React functional component
- Set CSS visibility to visible on button click - Reactjs
- Material UI TextField customization