Fix React 19 JSX type compatibility - #579
Merged
Merged
Conversation
andrewiggins
approved these changes
Aug 28, 2026
andrewiggins
left a comment
Contributor
There was a problem hiding this comment.
Thanks for the fix!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #505
This PR updates the JSX type declarations in
@shopify/app-bridge-reactto support React 19 while preserving compatibility with existing React 18 applications.Problem
The App Bridge React components currently augment JSX intrinsic elements through the global
JSXnamespace:With React 19, the JSX namespace is scoped to the react module. As a result, these custom App Bridge web components are no longer correctly recognized by TypeScript when used with React 19.
This can lead to type errors when using components such as:
Solution
Replace the global JSX declaration with React module augmentation:
The existing ref typing is preserved using import('react').LegacyRef, avoiding unnecessary direct type imports.
The change has been applied consistently to:
Modal
NavMenu
SaveBar
TitleBar
Compatibility
The implementation remains compatible with React 18 while enabling the expected JSX type resolution for React 19.
The existing App Bridge web component attributes and ref types are preserved.
Verification
The following checks pass successfully:
pnpm run type-check ✅
pnpm run lint ✅
pnpm run test ✅
git diff --check ✅
Manual JSX type verification with React 18 types ✅
No runtime behavior is changed by this PR; this is a TypeScript/JSX type compatibility fix.
Changeset
Added a patch changeset for @shopify/app-bridge-react.