Topic: You should not use <Route> or withRouter() outside a <Router>
Expected behavior*Should Display NavBar*Actual behavior**Error : You should not use or withRouter() outside a **Resources (screenshots, code snippets etc.)
I've wrapped the components with Index.js
import React from "react";
import { render } from "react-dom";import App from "./App";import "mdbreact/dist/css/mdb.css";//import "../src/css/customStyle.css";import { BrowserRouter } from "react-router-dom";
render( , document.getElementById("root"));
App. js
export class App extends Component {
render() { return ( ); }}
package.json;
"mdbreact": "^4.13.0",
"react": "^16.8.5",
"react-bootstrap": "^1.0.0-beta.8",
"react-dom": "^16.8.5",
"react-redux": "^7.0.2",
"react-router": "^5.0.0",
"react-router-dom": "^5.0.0",
Aliaksandr Andrasiuk staff answered 6 years ago
Hi,
Our MDBReact package has some problems with the react-router-dom
v.5.0.0.
Try to add an earlier version of react-router-dom
as a dependency in your package.json
file.
If it will not help please show me your code.
Best regards.
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- User: Free
- Premium support: No
- Technology: MDB React
- MDB Version: 4.13.0
- Device: Laptop
- Browser: Chrome
- OS: Windows
- Provided sample code: No
- Provided link: No