Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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



Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: