keep scroll when use useQuery #3266
Replies: 2 comments
-
scroll restoration should work, have a look here: https://react-query.tanstack.com/guides/scroll-restoration it also seems to not work so well with codesandbox, as described in this issue: FYI, react-query is not doing anything specific for scroll restoration. It's just that the browser should handle it because the data can be rendered synchronously, as we can retrieve it from the cache: https://developer.mozilla.org/en-US/docs/Web/API/History/scrollRestoration |
Beta Was this translation helpful? Give feedback.
-
@foreverchoi0706 I encountered a similar issue where the culprit was the line of code |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
When fetching data using useQuery, the browser scroll automatically goes up to the top. Is there a way to keep this scroll?
it my code
Beta Was this translation helpful? Give feedback.
All reactions