mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-03-01 13:16:42 +00:00
15 lines
292 B
TypeScript
15 lines
292 B
TypeScript
import { FC, useEffect } from 'react';
|
|
import { useLocation } from 'react-router-dom';
|
|
|
|
const ScrollToTop = (): FC => ({ children }) => {
|
|
const location = useLocation();
|
|
|
|
useEffect(() => {
|
|
scrollTo(0, 0);
|
|
}, [ location ]);
|
|
|
|
return <>{children}</>;
|
|
};
|
|
|
|
export default ScrollToTop;
|