mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-24 20:36:40 +07:00
10 lines
251 B
TypeScript
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]);
|
|
};
|