react-router v6.0.0-beta.0 Release Notes

Release Date: 2020-06-19 // over 1 year ago
  • ๐Ÿš€ Today we are very happy to release the first beta of React Router version 6!

    Major Features

    ๐Ÿš€ No new features in this release since alpha.5, besides the fact that we are now using history v5 stable in various places behind the scenes.

    Major Changes

    There are a few breaking changes from alpha.5:

    • ๐Ÿš€ Moved <Route preload> into the experimental release channel
    • ๐Ÿš€ Moved useLocationPending into the experimental release channel
    • Made react-router a regular dependency of react-router-dom and react-router-native
    • Made history a peer dependency
    • ๐Ÿ“‡ Renamed useResolvedLocation to useResolvedPath to be more inline with the naming in the history API
    • ๐Ÿ“‡ Renamed resolveLocation to resolvePath to be more inline with the naming in the history API

    ๐Ÿ›  Bugfixes

    • We now re-use the sourcemap output from tsc as input into the Rollup toolchain, so sourcemaps go all the way back to the original source instead of stopping at the tsc-generated files

    ๐Ÿ“„ Docs

    Installing

    Development for v6 is happening on the dev branch.

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

    $ npm install history [email protected]
    

    Or, if you're on React Native:

    $ yarn add history [email protected]
    

    Roadmap

    ๐Ÿ“š Now that we are in beta, you can expect fewer breaking changes (if any) between releases in the next channel. We are actively developing features targeted at supporting suspense for data loading in the experimental channel. The main thing left to do is documentation and guides (and fix bugs, ofc). If you can spare some time, we'd love to have some help :)

    ๐Ÿ“š 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.

    Enjoy!


Previous changes from v6.0.0-alpha.5

  • 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 [email protected] [email protected]
    

    Or, if you're on React Native:

    $ yarn add [email protected] [email protected]
    

    ๐Ÿ“š 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!