From 4f89a6f8ea18bc807c6a24819c76f15397cc6b0a Mon Sep 17 00:00:00 2001 From: Olivier Chafik Date: Tue, 21 Apr 2026 11:51:04 +0100 Subject: [PATCH] feat(react): forward autoResize from useApp to App (#622) useApp() previously hardcoded autoResize: true. Expose it as a hook option (default unchanged) so callers can disable the built-in ResizeObserver and drive sizing themselves. --- src/react/useApp.tsx | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/react/useApp.tsx b/src/react/useApp.tsx index 75b3e15..518d6ca 100644 --- a/src/react/useApp.tsx +++ b/src/react/useApp.tsx @@ -12,14 +12,17 @@ export * from "../app"; /** * Options for configuring the {@link useApp `useApp`} hook. * - * The `strict` option is forwarded to the underlying {@link App `App`} - * instance. For other {@link AppOptions `AppOptions`}, create the `App` - * manually instead of using this hook. + * The `autoResize` and `strict` options are forwarded to the underlying + * {@link App `App`} instance. For other {@link AppOptions `AppOptions`}, + * create the `App` manually instead of using this hook. * * @see {@link useApp `useApp`} for the hook that uses these options * @see {@link useAutoResize `useAutoResize`} for manual auto-resize control with custom `App` options */ -export interface UseAppOptions extends Pick { +export interface UseAppOptions extends Pick< + AppOptions, + "autoResize" | "strict" +> { /** App identification (name and version) */ appInfo: Implementation; /** @@ -126,6 +129,7 @@ export function useApp({ appInfo, capabilities, onAppCreated, + autoResize = true, strict, }: UseAppOptions): AppState { const [app, setApp] = useState(null); @@ -141,10 +145,7 @@ export function useApp({ window.parent, window.parent, ); - const app = new App(appInfo, capabilities, { - autoResize: true, - strict, - }); + const app = new App(appInfo, capabilities, { autoResize, strict }); // Register handlers BEFORE connecting onAppCreated?.(app);