1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 12:56:41 +07:00

added experimental scroll helper

This commit is contained in:
Fedor Katurov 2022-01-10 16:47:29 +07:00
parent c2154e930c
commit 8d1e6989c2
8 changed files with 105 additions and 4 deletions

View file

@ -0,0 +1,10 @@
import { useCallback } from 'react';
import { useScrollHeight } from '~/hooks/dom/useScrollHeight';
export const useScrollToBottom = () => {
const top = useScrollHeight();
return useCallback(() => {
window.scrollTo({ top });
}, [top]);
};