React Router v6


Topic: React Router v6

Denzil asked 4 years ago

Hi,

With React Router v6 first beta released is it possible to run project with MDBLinks working?

Due to mdbreact included in project react router loaded twice:

─┬ react-router-dom@5.2.0
│   └── react-router@5.2.0 
├── react-router@6.0.0-beta.0 
└─┬ react-router-dom@6.0.0-beta.0

This creates an issue. Is there a solution?

Thanks.


Piotr Glejzer staff commented 4 years ago

Do you have some console errors with that? Probably the oldest components will not work with the latest version of RRD (v6).


Denzil answered 4 years ago

Yes, I'm receiving console error:

You should not use <Link> outside a <Router>

I assume its to do with MDBLink or similar using v5 router.


Piotr Glejzer staff commented 4 years ago

did you try to wrap your component with BrowserRouter from rrd?


Denzil commented 4 years ago

Yes, the component is wrapped with BrowserRouter.

The issue is, as explained by react team, with React Router component loaded twice: one is as dependency of MDB (v5.02), and second time as project dependency: v6-beta. I have not found a workaround and had to roll back to v5, though I would prefer to stick with 6 as it has so many new useful features, and a lot in there is so obvious, and code is much cleaner and easier to read.


Piotr Glejzer staff commented 4 years ago

we have to rewrite routing in our app to version 6 so it will be done in the future releases.


Denzil commented 4 years ago

understood, I had rolled back to v5 time being, please let me know as soon as you have v6 implemented, thanks.


Piotr Glejzer staff commented 4 years ago

We will let you know if we update this.


Talent pro premium priority answered 2 years ago

Hello, I have the same problem, is it resolved ?


Wojciech Staniszewski staff commented 2 years ago

It is not resolved and currently, we are focused on developing MDBReact 5. Please try to use React Router v5.


Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue
  • User: Free
  • Premium support: No
  • Technology: MDB React
  • MDB Version: 4.27.0
  • Device: MacBook
  • Browser: Safari
  • OS: MacOsx
  • Provided sample code: No
  • Provided link: No