from Hacker News

React Router 6

by wr1472 on 11/3/21, 10:19 PM with 48 comments

  • by sattoshi on 11/3/21, 11:48 PM

    Usually new versions excite me, but with React Router I can only wonder: how much of a re-write will I need to do?
  • by TranquilMarmot on 11/4/21, 4:43 AM

    The author of react-query (one of my favorite libraries) also just released the beta of yet another router called React Location: https://react-location.tanstack.com/

    I've used Reach Router in the past and it's also pretty nice, but I didn't see a reason to use it over React Router... https://reach.tech/router/

  • by yurishimo on 11/3/21, 11:52 PM

    I think we're at an interesting time for React routing. It seems like a ton of shops are standardizing on Next.js as a base for new projects, especially if you're building a pretty vanilla web app.

    Since Next takes care of routing for you, the need for projects like this operating at huge scales is diminishing. I'm glad they still exist for teams that want/need to own the entire application stack, but there are benefits from the community standardizing too.

    At my job (dev consulting agency), we're about to embark on rebuilding an in-house framework onto Next.js to take advantage of the larger community tooling and to simplify onboarding of new hires.

    React Router has so far made it through 6 iterations, it wouldn't surprise me if v7 was some sort of drop-in plugin replacement within Next. It could open up some areas for more complex navigation requirements without some of the hacky workarounds you need in Next currently.

    Interesting times indeed!

  • by vbg on 11/4/21, 10:02 AM

    I still feel resentful about how earlier versions of react router had massive breaking changes effectively completely changing it, provided no documentation and no help at all even understanding the new thing let alone explaining how to upgrade.

    To be fair I believe I once read they now don’t do that but it was truly scarring to naively update to the newest version thinking my app would need a few tweaks to get going again, when in fact big chunks needed rewriting, with zero help from the developers.

  • by jimrandomh on 11/4/21, 5:55 PM

    I really don't think react-router provides enough functionality to justify the amount of churn it's generating. URL routing is not complicated and not hard. After getting dragged through a v3->v4 upgrade by a library we use, I put in a lint rule forcing all usages of it to go through a wrapper.
  • by throwaway4good on 11/4/21, 5:52 AM

    I am I the only who finds this library a wee bit overengineered?
  • by bern4444 on 11/4/21, 1:37 PM

    The authors of React Router are developing a framework for React called remix[0]. It's not available yet, but it will be soon and it will be open source.

    Remix will certainly use react-router and I expect it to be similar to NextJS but better. My expectation is Remix will blow NextJS out of the water and become the defacto starting point like how NextJS is today.

    [0] remix.run

  • by machiaweliczny on 11/4/21, 8:45 AM

    Is routing so hard you have to revamp it 6 times?