Commit a15e22e8 authored by William Li's avatar William Li Committed by Joe Haddad

updated links from #useRouter to #userouter (#8362)

Links pointing to #useRouter doesn't work. They need to be #userouter
parent 874b5338
......@@ -631,7 +631,7 @@ Client-side routing behaves exactly like the browser:
2. If it defines `getInitialProps`, data is fetched. If an error occurs, `_error.js` is rendered.
3. After 1 and 2 complete, `pushState` is performed and the new component is rendered.
To inject the `pathname`, `query` or `asPath` in your component, you can use the [useRouter](#useRouter) hook, or [withRouter](#using-a-higher-order-component) for class components.
To inject the `pathname`, `query` or `asPath` in your component, you can use the [useRouter](#userouter) hook, or [withRouter](#using-a-higher-order-component) for class components.
##### With URL object
......@@ -895,7 +895,7 @@ Router.events.on('routeChangeError', (err, url) => {
</ul>
</details>
Shallow routing allows you to change the URL without running `getInitialProps`. You'll receive the updated `pathname` and the `query` via the `router` prop (injected by using [`useRouter`](#useRouter) or [`withRouter`](#using-a-higher-order-component)), without losing state.
Shallow routing allows you to change the URL without running `getInitialProps`. You'll receive the updated `pathname` and the `query` via the `router` prop (injected by using [`useRouter`](#userouter) or [`withRouter`](#using-a-higher-order-component)), without losing state.
You can do this by invoking either `Router.push` or `Router.replace` with the `shallow: true` option. Here's an example:
......@@ -975,7 +975,7 @@ The above `router` object comes with an API similar to [`next/router`](#imperati
</ul>
</details>
If [useRouter](#useRouter) is not the best fit for you, `withRouter` can also add the same `router` object to any component, here's how to use it:
If [useRouter](#userouter) is not the best fit for you, `withRouter` can also add the same `router` object to any component, here's how to use it:
```jsx
import { withRouter } from 'next/router'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment