Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(router.md) Add note about page state and navigation #26320

Merged
merged 7 commits into from
Jun 21, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/api-reference/next/router.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ export default function Page() {
}
```

Note: when navigating to the same page in Next.js the page's state will not be reset by default as the top-level react component is the same. You can manually ensure the state is updated using `useEffect` or adding a `key` prop with the `asPath` to the components who's state should be reset.
ijjk marked this conversation as resolved.
Show resolved Hide resolved

Redirecting the user to `pages/login.js`, useful for pages behind [authentication](/docs/authentication):

```jsx
Expand Down