react-router-dom default version problem.
Use hashrouter instead to solve
import { HashRouter, Route, Switch, Redirect, Link } from ‘react-router-dom’
<HashRouter> <Switch> <Route path="app" component={App} /> <Route path="about" component={About} /> <Route path="inbox" component={Inbox}> <Route path="messages/:id" component={Message} /> </Route> <Redirect from="/" to="/app" exact /> </Switch> </HashRouter>
Similar Posts:
- Uncaught SyntaxError: The requested module ‘/node_modules/.vite/react-router……Switch
- Vue: How to use Vue-router in Axios
- Vue adds route errors dynamically: Uncaught Error… [How to Solve]
- Vue3 router view keep alive include does not work [How to Solve]
- Vue new page Jump [Three Method to Use]
- Warning: Input is changing an uncontrolled input of type text to be controlled…
- Component is missing template or render function [How to Solve]
- [Solved] VUE Project Error: Avoided redundant navigation to current location: “/XXX“