mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-03-02 13:51:48 +00:00
13 lines
322 B
TypeScript
13 lines
322 B
TypeScript
import { PropsWithChildren, useEffect } from 'react';
|
|
import { RouteComponentProps } from 'react-router';
|
|
|
|
const ScrollToTop = () => ({ location, children }: PropsWithChildren<RouteComponentProps>) => {
|
|
useEffect(() => {
|
|
scrollTo(0, 0);
|
|
}, [ location ]);
|
|
|
|
return <>{children}</>;
|
|
};
|
|
|
|
export default ScrollToTop;
|