mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-07-21 19:21:57 +00:00
14 lines
325 B
TypeScript
14 lines
325 B
TypeScript
import type { FC, PropsWithChildren } from 'react';
|
|
import { useEffect } from 'react';
|
|
import { useLocation } from 'react-router';
|
|
|
|
export const ScrollToTop: FC<PropsWithChildren> = ({ children }) => {
|
|
const location = useLocation();
|
|
|
|
useEffect(() => {
|
|
scrollTo(0, 0);
|
|
}, [location]);
|
|
|
|
return <>{children}</>;
|
|
};
|