You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
as example, i wanna create useResize hook, correct me please if im doing it wrong
constgetSize=()=>({width: window.innerWidth,height: window.innerHeight,});exportdefaultfunctionuseResize(onResize=()=>{}){functionhandleResize(){if(typeofonResize==='function')onResize(getSize());}// We need get window size on first calluseEffect(()=>{handleResize();},[]);// Then we are subscribe to window `resize`useEventListener('resize',handleResize);}
The text was updated successfully, but these errors were encountered:
as example, i wanna create
useResize
hook, correct me please if im doing it wrongThe text was updated successfully, but these errors were encountered: