This release is based on v6.0.0-beta.0 and adds a few features that are targeted at supporting React suspense for data loading. These features are:
timeoutMsprop that may be passed to a
<NativeRouter>. This timeout dictates how long these routers will wait before transitioning to a new page after the URL has changed. The default
timeoutMsis 5000 (5 seconds).
useLocationPendinghook that returns
trueif a transition to a new location is pending
<Route preload>function that is called whenever a route matches and is about to render. This function is typically used for pre-seeing client-side data caches for data retrieval later during rendering, which may trigger suspense.
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.
If you'd like to test it out, install from npm:
$ npm install history react-router-dom@experimental
Or, if you're on React Native:
$ yarn add history 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. There is also a comprehensive API Reference.