This release adds support for data fetching with suspense using React's unstable_useTransition
API. It is based on v6.0.0-alpha.5.
Support for suspense is added via a timeoutMs
prop that may be passed to a <BrowserRouter>
, <HashRouter>
, <MemoryRouter>
, or <NativeRouter>
. Each of these use the prop internally to determine how long to wait to show the new page whenever the URL changes. The default timeoutMs
is 5000 (5 seconds).
What does "experimental" mean?
React Router v6's experimental release channel follows the same semantics as React's own experimental
channel, which means that it is used for features that are not yet ready for a stable release. Use the experimental releases to try out new features before they are released.
Installing
Development on v6's experimental channel is happening on the dev-experimental
branch.
If you'd like to test it out, install from npm:
$ npm install react-router@experimental react-router-dom@experimental
Or, if you're on React Native:
$ yarn add react-router@experimental react-router-native@experimental
We are actively working on documentation. For now, if you're just interested in testing things out you may be interested in the getting started guide. If you're interested in upgrading an existing app, please check out the v5 to v6 migration guide.
Enjoy!