MCP Apps Kit - v0.5.0
    Preparing search index...

    Function useSizeChangedNotifications

    • 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.

      Returns RefObject<HTMLElement>

      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>
      );
      }