npm react-router 6.0.0-alpha.5
v6.0.0-alpha.5

latest releases: 6.23.0-pre.0, 0.0.0-experimental-0f302655, 0.0.0-experimental-c7dd3d3a...
3 years ago

Major Features

  • Added <Route preload> and route.preload (JSX and useRoutes) APIs. The preload function will be called when the route has matched and is about to render.
  • Added <NavLink end> and <NavLink caseSensitive> to better control matching behavior of <NavLink>s

Major Changes

Warning: This release breaks compatibility with 6.0.0-alpha.4

  • Removed the <Router history> prop and moved responsibility for setting up/tearing down the listener (history.listen) into the wrapper components (<BrowserRouter>, <HashRouter>, etc.). <Router> is now a controlled component that just sets up context for the rest of the app.
  • Changed generatePath so it never returns placeholders. Instead, it will throw if a needed placeholder is missing.
  • Removed usage of React's experimental useTransition hook. We will publish our own "experimental" channel very soon with this hook added back in, but it won't be added back to the "next" channel (or stable) until it goes stable in React core.

Bugfixes

  • Fixed and improved several TypeScript interfaces

Docs

  • Added some docs for using the basename functionality to the migration guide

Installing

Development for v6 is happening on the dev branch.

If you'd like to test it out, install from npm:

$ npm install react-router@next react-router-dom@next

Or, if you're on React Native:

$ yarn add react-router@next react-router-native@next

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!

Don't miss a new react-router release

NewReleases is sending notifications on new releases.