Overview
setupSizeChangedNotifications() manually starts automatic size reporting to the host. It attaches a ResizeObserver to document.body and document.documentElement, sending ui/notifications/size-changed whenever the content dimensions change.
This method is automatically called by connect() when the App is created with autoResize: true (the default). You only need to call it directly when:
- You created the
AppwithautoResize: falseand want to enable it later - You previously stopped auto-resize and want to restart it
Signature
Returns
A cleanup function that disconnects the
ResizeObserver and stops size reporting. Call this to disable auto-resize.Usage
Enable auto-resize after connection
Temporarily disable auto-resize
Conditional auto-resize
How It Works
The method creates aResizeObserver that watches:
document.documentElement— catches viewport-level changesdocument.body— catches content-level changes
scrollWidth and scrollHeight of document.documentElement to the host via sendSizeChanged().
Related
sendSizeChanged()— Manually send a one-time size updateuseAutoResize— React hook that wraps this method- Auto-Resize — How auto-resize works in the
Appclass