rsnext/examples/active-class-name/components
xhoantran a38e144099
Update examples/active-class-name (#34205)
## Description

According to `Next.js` useRouter documentation:

- `asPath`: The path (including the query) shown in the browser without the configured basePath or locale.
- `pathname`: Current route. That is the path of the page in /pages, the configured basePath or locale is not included.

`asPath` should not be used as the props of components. There are many cases that `asPath` not working as expected. For example:

- `asPath` is different on server-side and client-side.
- `asPath` can contains `id` and `query`.

## Suggestion

- Warning the use of `asPath` can lead to the conflict of client and server-side.
- Update `useRouter` document.

## Bug

- [x] Related issues linked using `fixes #number`

Fixes: https://github.com/vercel/next.js/issues/34144
Fixes: https://github.com/vercel/next.js/issues/34016
Fixes: https://github.com/vercel/next.js/issues/34197
2022-02-11 00:51:56 +00:00
..
ActiveLink.js Update examples/active-class-name (#34205) 2022-02-11 00:51:56 +00:00
Nav.js Update examples/active-class-name (#34205) 2022-02-11 00:51:56 +00:00