[Snyk] Upgrade react-router-dom from 4.3.1 to 5.1.2 #5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Snyk has created this PR to upgrade
react-router-dom
from 4.3.1 to 5.1.2.Warning: This is a major version upgrade, and may be a breaking change.
Release notes
List of commits
Bugfixes
<Link ref>
error on React 15 (#6954)List of commits
Bugfixes
Read the blog post
List of commits
Features
useParams
,useLocation
,useHistory
, anduseRouteMatch
hooks (d6224d6)forwardRef
in<Link>
(b5528ed)<Link to>
and<NavLink to>
(#5331, #5368)<Link component>
API (#5437)Bugfixes
<Route children>
elements when the<Route>
does not match (9665659)Changes
Updates
Bugfixes
Thanks to @StringEpsilon for putting this list together. Enjoy!
Note: While this does have a major version bump, it is actually a minor release. We screwed up some of the dependency version selection in 4.3.1, which necessitated a major bump. See this blog post for details.
Please ensure you have upgraded both
react-router
andreact-router-dom
(react-router-native
for RN users) to the exact same version. If different versions of those two packages are in your application, you will get errors when using<Link>
and otherreact-router-dom
-specific components. You can ensure you have the correct versions of both packages in your app usingnpm ls react-router react-router-dom
.Breaking Changes
withRouter()
or a<Route/>
instead.Refactor as follows:
New Features
<Route />
now supports an array of paths - #5889 (thanks @baronswindle)Full Changelog
<Route />
now supports multiple child nodes when using react >= 16.0.componentWillMount
andcomponentWillReceiveProps
<StrictMode/>
<Link />
not working properly with target="_self" - #6138 (thanks @ericyang89)eval
in development to be compliant with unsafe-eval CSP - #6611babel-preset-env
🧐 View latest project report
🛠 Adjust upgrade PR settings
🔕 Ignore this dependency or unsubscribe from future upgrade PRs