DEV Community


Discussion on: Use next.js with react-router

8kigai profile image

Hi, is that a typo in the static router closing tag in // next/with-react-router.js ??


And also I am wondering what is the benefit of using react router instead of next/router?

toomuchdesign profile image
Andrea Carraro Author

Hi @8kigai , yep, definitely a typo, thanks for pointing out.
The 2 routing systems take 2 very different approaches. There's not best one but just tradeoffs.

In my last project we had an architectural setup which made very hard to write custom server configuration to properly handle custom url parameters. They come for almost free with react-router, for example.

The codebase was also very bound to react-router's ability of rendering nested Route components instead of relying on file system routing.