Skip to content

v1.20.0

Latest
Compare
Choose a tag to compare
@oedotme oedotme released this 07 Feb 17:46
v1.20.0
ec147f5

Breaking changes - React Router integration ONLY

To avoid runtime errors due to React Router versions mismatch, it's now recommended to:

  1. Upgrade react-router-dom to v7+
  2. Replace react-router-dom package with react-router

Here are the upgrade steps from the upgrade guide to v7 at React Router docs:

  • Upgrade react-router-dom to v7+
npm install react-router-dom@latest
  • Replace react-router-dom with react-router
npm uninstall react-router-dom
npm install react-router@latest
  • Update imports
-import { useLocation } from 'react-router-dom'
+import { useLocation } from 'react-router'

Instead of manually updating imports, you can use this command. Make sure your git working tree is clean though so you can revert if it doesn't work as expected.

find ./path/to/src \( -name "*.tsx" -o -name "*.ts" -o -name "*.js" -o -name "*.jsx" \) -type f -exec sed -i '' 's|from "react-router-dom"|from "react-router"|g' {} +

If you have GNU sed installed (most Linux distributions), use this command instead:

find ./path/to/src \( -name "*.tsx" -o -name "*.ts" -o -name "*.js" -o -name "*.jsx" \) -type f -exec sed -i 's|from "react-router-dom"|from "react-router"|g' {} +

Commits

Changelog: v1.19.11...v1.20.0