ext-apps/src/react
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Olivier Chafik cc02e17e21
fix(react): StrictMode cleanup + relax late-handler guard for re-reg (#631)
* fix(react): close App on useApp unmount; relax late-handler guard for re-registration

useApp's effect cleanup now closes the App (and its transport) instead
of only flipping a `mounted` flag. Under React StrictMode dev
double-invoke, the abandoned first instance's PostMessageTransport
otherwise keeps a window `message` listener and receives every host
postMessage alongside the second instance.

The late-handler guard from #629 now tracks `_everHadListener` per
event and only flags the *first* registration of a one-shot event
post-handshake. Re-registration (React useEffect cleanup + re-add on
dep change) of an event that had a pre-connect handler is silent,
including under `strict: true`.

* feat(app-bridge): warn on second ui/initialize

If a View double-mounts (e.g. React StrictMode in dev) without closing
the previous App, AppBridge now logs a console.warn when it receives a
second ui/initialize. Behavior is unchanged — it still responds and the
latest appInfo/appCapabilities replace the previous values — this is
purely a diagnostic for host implementers.
2026-04-21 15:44:57 +01:00
..
index.examples.tsx Move JSDoc examples to type-checked .examples.ts files 2026-01-19 20:41:19 -06:00
index.tsx Replace {@includeCode} with synced code fences 2026-01-23 07:34:56 -06:00
useApp.examples.tsx Improve patterns guide with concrete examples and safe area insets 2026-01-27 17:32:41 -06:00
useApp.tsx fix(react): StrictMode cleanup + relax late-handler guard for re-reg (#631) 2026-04-21 15:44:57 +01:00
useAutoResize.examples.tsx Move JSDoc examples to type-checked .examples.ts files 2026-01-19 20:41:19 -06:00
useAutoResize.ts Replace {@includeCode} with synced code fences 2026-01-23 07:34:56 -06:00
useDocumentTheme.examples.tsx Move JSDoc examples to type-checked .examples.ts files 2026-01-19 20:41:19 -06:00
useDocumentTheme.ts Replace {@includeCode} with synced code fences 2026-01-23 07:34:56 -06:00
useHostStyles.examples.tsx Refine JSDoc examples for consistency and type safety 2026-01-19 20:43:47 -06:00
useHostStyles.ts Add addEventListener/removeEventListener with DOM-model on* semantics (#573) 2026-03-30 18:48:33 +01:00