@googleforcreators/react
Version:
A tiny wrapper package that re-exports React and provides additional utilities and custom hooks.
3 lines (2 loc) • 457 B
JavaScript
var e=require("react");module.exports=function(t,r,n=void 0){e.useEffect((()=>{if(!t?.current||!ResizeObserver)return;const e=new ResizeObserver((e=>{window.requestAnimationFrame((()=>{if(!t?.current)return;const n=void 0!==e?.length&&e?.length>0?e[e.length-1]:null;if(n){const{width:e,height:t}=n.contentRect;r({width:e,height:t})}}))}));return e.observe(t?.current),()=>{e.disconnect()}}),n||[])};
//# sourceMappingURL=useResizeEffect.js.map
;