Changelog History
Page 1
-
v6.0.0-beta.0 Changes
June 19, 2020๐ 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 ofreact-router-dom
andreact-router-native
- Made
history
a peer dependency - ๐ Renamed
useResolvedLocation
touseResolvedPath
to be more inline with the naming in the history API - ๐ Renamed
resolveLocation
toresolvePath
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
- โ Added a comprehensive API Reference
- โก๏ธ Updated the contributing guide
Installing
Development for v6 is happening on the
dev
branch.โ If you'd like to test it out, install from npm:
$ npm install history react-router-dom@next
Or, if you're on React Native:
$ yarn add history react-router-native@next
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 theexperimental
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!
- ๐ Moved
-
v6.0.0-alpha.5 Changes
May 15, 2020Major Features
- โ Added
<Route preload>
androute.preload
(JSX anduseRoutes
) APIs. Thepreload
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 willthrow
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!
- โ Added
-
v6.0.0-alpha.4 Changes
May 05, 2020๐ Lots of great stuff in this release, especially if you like Intellisense :)
Major Features
- Migrated the core codebase to TypeScript and added TypeScript declarations
- โ Added a migration guide for folks coming from reach/router
- โ Added
useInRouterContext
hook for determining if you're in the context of a router or not - โ Added
useLocationPending
hook (experimental) - โ Added
matchPath
function for manually matching paths to URL pathnames
๐ Note: experimental features rely on an experimental release of React and will probably be moved into a separate "experimental" release channel in the near future.
Major Changes
๐ Warning: This release breaks compatibility with 6.0.0-alpha.3
- โก๏ธ
useSearchParams
now returns[searchParams, setSearchParams]
(similar touseState
).setSearchParams
is a wrapper fornavigate
that updates the query string on the current URL. See the updated guide on working with the query string. - โ Removed the
<StaticRouter context>
API. We don't support navigation on the initial render in v6, so this API is unnecessary. useMatch
takes a routepath
(instead of a linkto
value as it did previously). It should have always taken a route path; this was just a simple oversight.
๐ Bugfixes
- ๐ Fixed a bug with multiple nested * routes
- ๐ป Force stable sort in browsers that don't have it so routes that otherwise rank equally maintain the order in which they were originally defined
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!
-
v6.0.0-alpha.3 Changes
April 04, 2020Major Features
- โ Added a new
useSearchParams
hook (see f59ee54)
๐ The
useSearchParams
hook returns aURLSearchParams
object created from the currentlocation.search
string. This is a feature that people have wanted for a while, but we were always hesitant to ship a full-blown query parser with the router. Well, now that we haveURLSearchParams
widely available, we don't have to. I wrote up a small guide about how to useuseSearchParams
if you'd like to read more.Major Changes
๐ Warning: This release breaks compatibility with 6.0.0-alpha.2
- ๐
Redirect
(andredirectTo
inuseRoutes
) was removed (see cbcd398) - ๐ We no longer support redirecting on the initial render, due to compatibility issues with future versions of React
โก๏ธ React won't let us change the state in an ancestor component on the initial render w/out warning, so we had to remove the
<Redirect>
component, as well as the ability to do anavigate()
on the initial render. You can still render a<Navigate>
, but it won't actually update the page until the next render.๐ป If you really need to redirect on the initial render, you can either a) do it on your server (probably best, so it can be cached at the HTTP level instead of doing it in every user's browser) or b) do it outside of React Router (e.g. using the history API directly).
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@6 react-router-dom@6
Or, if you're on React Native:
$ yarn add react-router@6 react-router-native@6
๐ 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!
- โ Added a new
-
v6.0.0-alpha.2 Changes
February 22, 2020๐ This release fixes a few bugs with the previous alpha, namely:
- ๐ Fix a few path matching corner cases
- ๐ Fix rendering
<Link>
s on the server (see #7126, thanks @danpantry)
๐ Also, we added a new doc about adding React Router to your web project whether you're using create-react-app, Webpack, Parcel, or just plain 'ol
<script>
tags. Thanks @chancestrickland!Development for v6 is happening on the
dev
branch.โ If you'd like to test it out, install from npm:
$ npm install history@5 react-router@6 react-router-dom@6
Or, if you're on React Native:
$ yarn add history@5 react-router@6 react-router-native@6
๐ 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!
-
v6.0.0-alpha.1 Changes
February 01, 2020๐ Moved
history
frompeerDependencies
todependencies
. This should make it easier for people to install and test. -
v6.0.0-alpha.0 Changes
January 31, 2020๐ First alpha release of the next major version of React Router, version 6. A few of the highlights are:
- Relative routes and links
- Nested
<Route>
s - Automatic
<Route>
ranking with a new<Routes>
API - ๐ New suspense-ready
navigate
API useRoutes
+matchRoutes
for using object-based routing API
Development for v6 is happening on the
dev
branch.โ If you'd like to test it out, install from npm:
$ npm install history@5 react-router@6 react-router-dom@6
Or, if you're on React Native:
$ yarn add history@5 react-router@6 react-router-native@6
๐ 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.
Please note that although there are several breaking changes we are still working on the migration path and will continue to publish improvements and helpers in v5 that should help you upgrade as smoothly as possible. We are not done with v5. Heck, we're still cutting releases of v3.
๐ This release addresses several long-standing issues and pitfalls with previous releases. We are focused on providing a smooth upgrade path for both v4/5 users and v3 users who would like to make the jump to v6. We will be publishing more very soon.
Enjoy!
-
v5.2.0 Changes
May 11, 2020๐ This release includes a notable performance boost by separating the "Router" context from the "History" context internally. We also allow every element type for
Link
'scomponent
prop and support asensitive
prop on NavLink for control over case sensitive matching.Enjoy!
Changes
- โ Add
sensitive
prop on NavLink (#7251 by @caseywebdev) - ๐ Fix Link
component
prop type check (#7276 by @ypyakymiv) - โก๏ธ Update
mini-create-react-context
(#7288 by @patricksmms) - Separate
history
to its own context (#7103 by @illuminist)
- โ Add
-
v5.1.2 Changes
September 30, 2019 -
v5.1.1 Changes
September 27, 2019List of commits
๐ Bugfixes