1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-24 20:36:40 +07:00
vault-frontend/src/hooks/dom/useScrollToBottom.ts
2022-01-10 16:47:29 +07:00

10 lines
251 B
TypeScript

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