Skip to content

Releases: remix-run/react-router

v2.3.0

25 Apr 16:13
Compare
Choose a tag to compare

Changes

  • Feature: Add applyRouterMiddleware for extending router rendering (#3327)
  • Feature/Deprecation: Add routerShape and locationShape as top-level exported prop types, and deprecate all the old prop types, including the ones that were previously incorrectly removed (#3349)
  • Minor: Move ES module build back to es6/ to avoid breaking people who were incorrectly importing from react-router/es6 (#3334)

v2.2.4

25 Apr 16:12
Compare
Choose a tag to compare

Changes

  • Noop: Publish again to npm to work around missing tarball problem

v2.2.3

25 Apr 16:12
Compare
Choose a tag to compare

Changes

  • Bugfix: Don't use Object.assign in getComponentsForRoute (#3331)
  • Minor: Speed up checking index path active status (#3313)

v2.2.2

25 Apr 16:11
Compare
Choose a tag to compare

Changes

  • Bugfix: Fix edge cases with continuing matches after pathless routes (#3308)

v2.2.1

25 Apr 16:11
Compare
Choose a tag to compare

Changes

  • Bugfix: Fix this in getComponent and getComponents (#3306)

v2.2.0

25 Apr 16:10
Compare
Choose a tag to compare

Changes

  • Feature/Deprecation: Call getComponent and getComponents with nextState; deprecate accessing location directly in favor of nextState.location there (#3298, Upgrade Guide)
  • Bugfix: Do not ignore extraneous slashes in matching (#3285)
  • Bugfix: Do not unnecessarily set empty className on <Link> (#3288)
  • Minor: Update PropTypes (#3218)
  • Minor: Move ES module build from es6/ to es/ (#3295)
  • Minor: Do not include unused deprecation logic in production builds (#3296)

v2.1.1

25 Apr 16:06
Compare
Choose a tag to compare

Changes

  • Bugfix: Remove unintentionally released code change (#3280)

v2.1.0

25 Apr 16:06
Compare
Choose a tag to compare

Changes

  • Feature: Add support for onChange hook on routes (#3108)
  • Minor: Include full warning messages in non-minified UMD build (#3213)
  • Minor: Speed up path matching (#3217)

v2.0.1

25 Apr 16:05
Compare
Choose a tag to compare

Changes

  • Bugfix: Call transition hooks on child routes of parents whose params
    changed but the child's did not. (#3166)
  • Minor: Remove support for installing from source (#3164)

v2.0.0

10 Feb 18:06
Compare
Choose a tag to compare

Read the Full Upgrade Guide

Goals

You might enjoy reading this issue: #2646

  1. Clear up the coupling between History and Router with simpler APIs.
  2. Provide cleaner integrations with other libraries like Redux, Relay, Async Props etc.
  3. Stop providing API that conceals usage of context. It is now a documented feature of React so developers using Router can implement their own opinions on how best to use context: Mixins, higher-order components, decorators, etc. React Router no longer has an opinion, but instead uses the lowest level feature of React. This project wants to be an incredibly useful routing library and doesn't want to get hung up on best-practice patterns for getting stuff from up top to down low.
  4. Draw a clean line between what goes to Route Components as props and what goes on context.

For a lot of apps this upgrade might look like API churn. Underneath the hood there are significant differences that make integrating with the rest of the React ecosystem more straightforward. Thanks for your continued patience and support as we all build this tool together. It's hard to imagine the top-level API changing much after this. But if it does, rest assured we are committed to ...

Backwards Compatibility and Deprecation Warnings

This has been a community project from the start, we need your help making the upgrade as smooth as possible for everybody!

We have done our best to provide backwards compatibility with deprecated APIs. If you drop in v2.x into a v1.x application and it doesn't run, then there is a bug. Please open an issue when you discover what the problem is so we can get a fix out.

The deprecation warnings should also lead you to the relevant part of this document. If one doesn't, please open a pull request with a fix. Also, if any part of this document could be improved, please let us know how. Confound it, our bias is often inescapable!

Upgrade Automatically with Codemods

Using a tool called jscodeshift, we have made available some codemods for upgrading your code to the new APIs automatically: https://github.com/rackt/rackt-codemod

A codemod is much like Babel, but instead of converting your ES2015 code to ES5 compatible syntax, it does a limited set of transformations on function names, arguments, common patterns and more. One way to think of jscodeshift (the underlying tool) is "jQuery for code". These codemods aren't bulletproof, so be sure to test your code after you run them. But they can help with upgrading a large codebase to remove deprecation warnings you're now triggering.

Changes since rc6

  • Add back basename support in match (#3054)