react-router
8.5.1 · 27 Oct 2026MIT80.5M / weekRepositorynpmAtom feed
Upgrading react-router From 4.4.0 to 5.0.0
1 release in betweenevery note read
Reading releases, release notes and advisories…
- 5
- changes to make
- 0
- advisories fixed
- 3
- new
- 2
- fixes
Before you upgrade
Tick each one off as you go- Breaking5.0.0
- Breaking5.0.0
- Breaking5.0.0
- Breaking5.0.0
- Deprecated5.0.0
Release by release
- Breaking
Since the old context API is no longer used, any access to the old context will fail. Use of the react router context is not supported, please use
withRouter()or a<Route/>instead. - Breaking
Due to the new context API, mixing of imports will now result in an exception:
- Breaking
In development mode, we now throw an error when using 2 different builds (see b2c6fa0), i.E. combining CJS imports with ESM imports.
- Breaking
Removed deprecated lifecycle methods
componentWillMountandcomponentWillReceiveProps
- Breaking
11 other lines we could not sort, mostly version bumps
- 5.0.0
<Route />now supports multiple child nodes when using react >= 16.0. - 5.0.0
Migrated to new react context API, with a polyfill for react versions < 16.2
- 5.0.0
Smaller build size
- 5.0.0
Package now includes pre-minified files
- 5.0.0
Package now consists of single-file builds that include all modules.
- 5.0.0
Upgraded to history 4.9.0
- 5.0.0
Made sure that react router conforms to react
<StrictMode/> - 5.0.0
Removed use of
evalin development to be compliant with unsafe-eval CSP - #6611 - 5.0.0
Migrated to
babel-preset-env - 5.0.0
Improved testing infrastructure to improve developer workflow
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.