Topic: Error: Invariant failed: You should not use <NavLink> outside a <Router>

dtremblay.grt premium asked 4 years ago


Expected behavior Using the nav inside a router should not break the code requesting to use it inside a router

Actual behavior Using the nav inside a router breaks the code requesting to use it inside a router

Please note that the second browserrouter was added to try to solve the issue but hasn't.

Resources (screenshots, code snippets etc.) enter image description here enter image description here


dtremblay.grt premium answered 4 years ago


After some tests, it seems that the react-router-dom was doubled in the lock file.

Both of them were in conflict with each other which caused the issue. This issue is closed.



Please insert min. 20 characters.

FREE CONSULTATION

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

Status

Resolved

Specification of the issue

  • ForumUser: Premium
  • Premium support: Yes
  • Technology: MDB React
  • MDB Version: 4.25.1
  • Device: PC
  • Browser: Chrome
  • OS: Windows 10
  • Provided sample code: No
  • Provided link: No