Skip to content

Releases: remix-run/react-router

v4.4.0-beta.7

02 Mar 01:26
Compare
Choose a tag to compare
v4.4.0-beta.7 Pre-release
Pre-release
  • Fixed tree-shaking with Webpack (see #6464 and #6465)
  • Added support for createRef in <Link innerRef> (see #6567)
  • We now throw an error when using 2 different builds (dev only, see b2c6fa0)

v4.4.0-beta.6

01 Nov 16:43
Compare
Choose a tag to compare
v4.4.0-beta.6 Pre-release
Pre-release

Fixes

  • Fixed import of react-is in the CommonJS build (see #6445)
  • Added missing prop-types dependency for ESM build (see #6438)

v4.4.0-beta.5

30 Oct 22:45
Compare
Choose a tag to compare
v4.4.0-beta.5 Pre-release
Pre-release

Fixes

  • Fixed <Route component> prop-type warning when using forwardRef (see #6417, thanks @frehner and @eXon)
  • Added missing file to react-router-config package (see #6415, thanks @Anomen)
  • Several docs improvements (see #6410, thanks @justsml)

v4.4.0-beta.4

17 Oct 01:13
Compare
Choose a tag to compare
v4.4.0-beta.4 Pre-release
Pre-release

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

15 Oct 18:55
Compare
Choose a tag to compare
v4.4.0-beta.3 Pre-release
Pre-release
  • Fixed ESM entry point from 4.4.0-beta.2 🤦‍♂️

v4.4.0-beta.2

14 Oct 03:47
Compare
Choose a tag to compare
v4.4.0-beta.2 Pre-release
Pre-release

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

30 Sep 07:28
Compare
Choose a tag to compare
v4.4.0-beta.1 Pre-release
Pre-release

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

29 Sep 07:39
Compare
Choose a tag to compare
v4.4.0-beta.0 Pre-release
Pre-release

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 and componentWillReceiveProps

🚨 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 deprecated babel-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 in react-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

06 Jun 19:30
3d233bf
Compare
Choose a tag to compare

Just a patch to fix an accidental move of warning from a normal dependency to a devDependency, which was causing issues with installation.

v4.3.0

06 Jun 15:36
7222316
Compare
Choose a tag to compare

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