Hook to set up automatic size change notifications
Creates a ResizeObserver that automatically sends size changed notifications to the host when the observed element resizes.
Ref to attach to the element to observe
function AutoSizeWidget() { const containerRef = useSizeChangedNotifications(); return ( <div ref={containerRef}> <p>Content that may change size...</p> </div> );} Copy
function AutoSizeWidget() { const containerRef = useSizeChangedNotifications(); return ( <div ref={containerRef}> <p>Content that may change size...</p> </div> );}
Hook to set up automatic size change notifications
Creates a ResizeObserver that automatically sends size changed notifications to the host when the observed element resizes.