@terra-dev/use-router-scroll-restoration
v0.20.1
Published
Scroll restore to 0,0 when the router path is changed
Downloads
7
Readme
@terra-dev/use-router-scroll-restoration
Scroll restore to 0,0 when the router path is changed
import { useRouterScrollRestoration } from '@terra-dev/use-router-scroll-restoration';
function App() {
useRouterScrollRestoration();
return <YOUR_APP />;
}
Or
import { RouterScrollRestoration } from '@terra-dev/use-router-scroll-restoration';
function App() {
return (
<div>
<RouterScrollRestoration />
<YOUR_APP />
</div>
);
}