Overview
useAutoResize enables automatic size reporting to the host via ResizeObserver. It watches document.body and document.documentElement for size changes and sends ui/notifications/size-changed notifications.
This hook is rarely needed. The
useApp hook creates the App with autoResize: true by default, which handles this automatically. Only use useAutoResize if you create the App manually with autoResize: false.Signature
The connected
App instance, or null during initialization.Usage
How It Works
The hook callsapp.setupSizeChangedNotifications() when app becomes non-null, and disconnects the ResizeObserver when the component unmounts. The observer monitors both document.documentElement and document.body to catch all size changes.