Files
Infinitustx/apps/web/src/components/ScrollToTop.jsx
T
Andres Santana 47cf941ba7
Verificar despliegue Docker / build (push) Has been cancelled
Add project files
2026-10-02 11:12:37 -04:00

14 lines
322 B
React

import { useLocation } from 'react-router-dom';
import { useLayoutEffect } from 'react';
const ScrollToTop = () => {
const { pathname } = useLocation();
useLayoutEffect(() => {
window.scrollTo({ top: 0, left: 0, behavior: 'instant' });
}, [pathname]);
return null;
}
export default ScrollToTop;