Repository navigation
|
When using useHistory, changing only the query parameters for the same path will return the scroll position to the top. |
Answered by
Josh-Cena
Apr 5, 2022
Replies: 1 comment 1 reply
|
When pushing or replacing history, you need to save the scroll position as state. See our own implementation on the showcase page: |
1 reply
Answer selected by
dninomiya
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When pushing or replacing history, you need to save the scroll position as state. See our own implementation on the showcase page:
https://github.com/facebook/docusaurus/blob/e610a4ac002e561b8adee5558b178168a2e26742/website/src/pages/showcase/index.tsx#L48-L67