clash_for_linux/dashboard/public/assets/useRemainingViewPortHeight.7baef998.js
2022-02-17 14:30:03 +08:00

2 lines
356 B
JavaScript

import{j as r}from"./vendor.38e754a4.js";const{useState:s,useRef:a,useCallback:u,useLayoutEffect:c}=r;function g(){const t=a(null),[n,i]=s(200),e=u(()=>{const{top:o}=t.current.getBoundingClientRect();i(window.innerHeight-o)},[]);return c(()=>(e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}),[e]),[t,n]}export{g as u};