Skip to content

Commit

Permalink
Update note about removing history dependency
Browse files Browse the repository at this point in the history
Fixes #8232
  • Loading branch information
mjackson committed Nov 5, 2021
1 parent f4bc70f commit 760f63d
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions docs/upgrading/v5.md
Expand Up @@ -142,18 +142,12 @@ Again, **once your app is upgraded to v5.1 you should test and deploy it**, and
For this step, you'll need to install React Router v6. If you're managing dependencies via npm:

```bash
$ npm install react-router-dom@next
$ npm install react-router-dom
# or, for a React Native app
$ npm install react-router-native@next
$ npm install react-router-native
```

> **Note:** If you also have `history` as a dependency in your `package.json`, you will also need to upgrade it to v5:
>
> ```bash
> $ npm install history@5
> ```
>
> 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.
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).

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

Expand Down

0 comments on commit 760f63d

Please sign in to comment.