▲ | fleebee 4 days ago | |
Depends on what you're using for routing. In Tanstack Router it's a boolean you set when creating the router. The documentation nicely lays out what's being done under the hood, and it's quite a bit.[1] I wouldn't try that at home. In React Router you just chuck a <ScrollRestoration /> somewhere in your DOM.[2] [1]: https://tanstack.com/router/v1/docs/framework/react/guide/sc... [2]: https://reactrouter.com/6.30.1/components/scroll-restoration |