Skip to content

v4.0.0-0

Pre-release
Pre-release
Compare
Choose a tag to compare
@timdorr timdorr released this 13 Sep 17:21
· 6036 commits to main since this release

⚠️ 🚀 NEW VERSION ALERT ⚠️

Available on npm: npm install react-router@next

This is a ground-up rewrite of React Router that @ryanflorence and @mjackson have been working on for the last few months (with a tiny bit of help from yours truly). The central thesis for this version is "declarative everything". Almost all imperative code is completely gone in 4.0.

The API is not only completely different, so is the way of thinking about routing in general. Async behaviors are gone, replaced by always rendering something (even if that's just a "Loading..." screen). There are no top-level route configuration, as you can "route" from anywhere in your component tree (but that doesn't keep you from creating your own route config).

We are working on an migration strategy that will allow you to run both version in tandem and update your routes incrementally.

Many of these familiar concepts are removed because they are best implemented from outside the router. v4 is much smaller in scope and code size, which is intentional. These, now external, features will eventually be implement as addon libraries, either provided officially or from the community.

As expected, there will be growing pains. And bugs. And Twitter flame wars 💦🔥. But this is a declarative, composable approach to routing that fits the declarative, composable model of React. Please let us know where it is not 100% awesome with issues and pull requests.

Quick Update:

Yes, there will still be a 3.0 release (soon!). It is simply v2.0 without any deprecation warnings. We intend to keep supporting the 3.x branch indefinitely (published separately on npm to aid in migration), although there will likely not be any future major versions based on that code. 4.0 is the future, but we won't leave you hanging if you want to stick with 2.x/3.x.

Examples and Docs Site