Skip to content

Commit

Permalink
docs(upgrading/v6): add linux example in Update imports section (#1…
Browse files Browse the repository at this point in the history
  • Loading branch information
sealer3 authored Nov 30, 2024
1 parent 0adfd60 commit 72f9af9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions contributors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@
- saul-atomrigs
- sbolel
- scarf005
- sealer3
- senseibarni
- sergiodxa
- sgalhs
Expand Down
6 changes: 6 additions & 0 deletions docs/upgrading/v6.md
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,12 @@ Instead of manually updating imports, you can use this command. Make sure your g
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:

```shellscript nonumber
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' {} +
```

👉 **Update DOM-specific imports**

`RouterProvider` and `HydratedRouter` come from a deep import because they depend on `"react-dom"`:
Expand Down

0 comments on commit 72f9af9

Please sign in to comment.