Releases: remix-run/react-router
v4.4.0-beta.7
v4.4.0-beta.6
v4.4.0-beta.5
v4.4.0-beta.4
Features
- Adds support for an array of paths in
<Route path>
(thanks @baronswindle)
Fixes
- Fix for
<Link rel="_self">
(thanks @ericyang89) - MUCH smaller CJS + ESM builds (thanks @pshrmn and @TrySound)
- Include required deprecation warning file for
require('react-router/Route')
statements (thanks @timdorr)
Enjoy! 😅
v4.4.0-beta.3
- Fixed ESM entry point from 4.4.0-beta.2 🤦♂️
v4.4.0-beta.2
Getting closer to 4.4 final! We've received some great feedback during the past few weeks on the 4.4 beta. Please keep it coming :)
Features
- Both our CJS and ESM builds now use Rollup, which means they are smaller and should be easier to consume. Requiring individual files (e.g.
require('react-router/Route')
) from any of our packages is no longer supported. - We now provide a pre-built production-ready CJS and ESM builds instead of requiring consumers to build it themselves.
Fixes
- Eliminate all warnings when using the router under React 16's
<StrictMode>
. In fact, we now wrap all our tests in<StrictMode>
! - Don't leak memory when a
<Router>
is rendered server side (introduced in a previous 4.4 beta).
Enjoy! 😅
v4.4.0-beta.1
This release fixes a few issues with the build in v4.4.0-beta.0 where the 4.4.0-beta.0
version was not specified correctly in the dependencies of react-router-dom
.
Also, please be careful which build you are using. Prior to this release, you could mix your import
styles, i.e.:
// Be careful, this won't work anymore!
import BrowserRouter from 'react-router-dom/BrowserRouter';
import { Route } from 'react-router-dom';
<BrowserRouter>
<Route />
</BrowserRouter>
The problem here is that, although it may not be obvious the first import
is actually using the CommonJS build while the 2nd import
is (probably, depending on what your bundler is doing) using the ES modules build. Your bundler can probably handle the variation in module formats just fine, but when you go to run your code you'll see a warning like:
You should not render a <Route> outside a <Router>
Basically, what this means is that <Route>
can't find the correct context object because each build has its own context object and the <Router>
component was imported from a different build!
Instead, just import both components using the same method:
// These are both from the same build and use the same context object
// so there won't be a mismatch :)
import { BrowserRouter, Route } from 'react-router-dom';
I'm going to try and figure out a better way to detect if you're using 2 different builds so we can give you a better warning.
Enjoy! 😅
v4.4.0-beta.0
This is primarily a maintenance release that is fully backwards compatible with 4.3.1 while also improving compatibility with React 16 and preparing for the future.
The main features of this release are:
- Removed the single-child restriction in
<Router>
so you can have multiple children, provided you're using React 16 - Migrated our underlying infrastructure to use React's new context API. A HUGE thank-you to @timdorr who provided the initial work required to migrate the codebase to React's new context API (see #5908)
- Removed all traces of the deprecated
componentWillMount
andcomponentWillReceiveProps
🚨 If you were accessing our private context API your code will break. If you need stuff on context, use a <Route>
or withRouter
instead. It's all the same stuff, and that's our public API 🚨
Other housekeeping that was done:
- Migrated to use
babel-preset-env
+ a custom list of proposal plugins we use instead of the deprecatedbabel-preset-es2015
+babel-preset-stage-1
- Improved testing infrastructure. Now, instead of running a build when you're working on e.g.
react-router-dom
and you need some changes inreact-router
, you don't have to go and rebuild it to test things out. This should make the repo easier to work with - Added some more warnings in dev mode
As always, you can try everything out using the next
tag:
yarn add react-router@next
yarn add react-router-dom@next
yarn add react-router-config@next
We will be paying close attention to the feedback on this release and hope to release 4.4.0 final soon!
Enjoy 😅
v4.3.1
v4.3.0
The major new things of this release are Redirect with params (see #5209) and the new generatePath
API. We also cleaned up the code with Prettier, so browsing through it should be more enjoyable.
One other thing to mention, while I have your attention, is the deprecation of react-router-redux. It's no longer maintained and has a number of fundamental problems (particularly around time travel). Integrating Redux and the DOM History API is challenging because they don't maintain the same semantics and the resulting integration is error prone. Getting to the router context will be easier in future versions of React Router, so the main motivations for needing it will be going away. So, while I would advise against trying to integrate the two, for those that still want this functionality can turn to libraries like @supasate's connected-react-router.
Changes
- Use the
pretty
option in generatePath (#6172 by @sibelius) - aria-current has incorrect value "true" (#6118 by @brandonrninefive)
- Redirect with parameters (#5209 by @dlindenkreuz)
- Fix with missing pathname:
<Link to="?foo=bar">
(#5489 by @pshrmn) - Escape NavLink path to allow special characters in path. (#5596 by @esiegel)
- Expose
generatePath
(#5661 by @rybon) - Use named import of history module. (#5589 by @RoboBurned)
- Hoist dependencies for smaller UMD builds (#5720 by @pshrmn)
- Remove aria-current from navLink when inactive (#5508 by @AlmeroSteyn)
- Add invariant for missing "to" property on
<Link>
(#5792 by @selbekk) - Use Prettier on the code (e6f9017 by @mjackson)
- Fix pathless route's match when parent is null (#5964 by @pshrmn)
- Use history.createLocation in
<StaticRouter>
(#5722 by @pshrmn)