Unverified Commit 2b761a9e authored by JJ Kasper's avatar JJ Kasper Committed by GitHub

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

This adds a note to the router doc explaining that page state is not reset by default when updating the URL but staying on the same page as this has come up in a few issues. 


## Documentation / Examples

- [x] Make sure the linting passes

x-ref: https://github.com/vercel/next.js/issues/26270
parent ad5e9bd6
......@@ -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`.
Redirecting the user to `pages/login.js`, useful for pages behind [authentication](/docs/authentication):
```jsx
......
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