mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2025-12-10 14:16:59 -06:00
14 lines
338 B
TypeScript
14 lines
338 B
TypeScript
import type { FC, PropsWithChildren } from 'react';
|
|
import { useEffect } from 'react';
|
|
import { useLocation } from 'react-router-dom';
|
|
|
|
export const ScrollToTop: FC<PropsWithChildren<unknown>> = ({ children }) => {
|
|
const location = useLocation();
|
|
|
|
useEffect(() => {
|
|
scrollTo(0, 0);
|
|
}, [location]);
|
|
|
|
return <>{children}</>;
|
|
};
|