We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hook para recuperar fácilmente el scroll de la página.
interface Scroll { x: number; y: number; } const useScroll = (): Scroll => { const [scroll, setScroll] = useState<Scroll>({ x: 0, y: 0 }); const updateScroll = (): void => setScroll({ x: window.scrollX, y: window.scrollY }); useEffect((): (() => void) => { window.addEventListener('scroll', updateScroll); updateScroll(); return (): void => { window.removeEventListener('scroll', updateScroll); }; }, []); return scroll; }; export default useScroll;
The text was updated successfully, but these errors were encountered:
miguelBinpar
No branches or pull requests
Hook para recuperar fácilmente el scroll de la página.
The text was updated successfully, but these errors were encountered: