mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-28 22:26:41 +07:00
17 lines
349 B
TypeScript
17 lines
349 B
TypeScript
const getHeight = () => {
|
|
if (typeof document === 'undefined') {
|
|
return 0;
|
|
}
|
|
|
|
const body = document.body;
|
|
const html = document.documentElement;
|
|
|
|
return Math.max(
|
|
body.scrollHeight,
|
|
body.offsetHeight,
|
|
html.clientHeight,
|
|
html.scrollHeight,
|
|
html.offsetHeight
|
|
);
|
|
};
|
|
export const useScrollHeight = () => getHeight();
|