Skip to content

Commit c6e9c06

Browse files
committed
Update note about removing history dependency
Fixes #8232
1 parent 1bb5370 commit c6e9c06

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

docs/upgrading/v5.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -142,18 +142,12 @@ Again, **once your app is upgraded to v5.1 you should test and deploy it**, and
142142
For this step, you'll need to install React Router v6. If you're managing dependencies via npm:
143143

144144
```bash
145-
$ npm install react-router-dom@next
145+
$ npm install react-router-dom
146146
# or, for a React Native app
147-
$ npm install react-router-native@next
147+
$ npm install react-router-native
148148
```
149149

150-
> **Note:** If you also have `history` as a dependency in your `package.json`, you will also need to upgrade it to v5:
151-
>
152-
> ```bash
153-
> $ npm install history@5
154-
> ```
155-
>
156-
> However, we recommend you remove it as a direct dependency, as we now wrap most of its APIs with hooks for better support of React Suspense.
150+
You'll also want to remove the `history` dependency from your package.json. The `history` library is a direct dependency of v6 (not a peer dep), so you won't ever import or use it directly. Instead, you'll use the `useNavigate()` hook for all navigation (see below).
157151

158152
### Upgrade all `<Switch>` elements to `<Routes>`
159153

0 commit comments

Comments
 (0)