Fix missing forwardRef in AppProxyForm and AppProxyLink#3098
Open
byrichardpowell wants to merge 4 commits intomainfrom
Open
Fix missing forwardRef in AppProxyForm and AppProxyLink#3098byrichardpowell wants to merge 4 commits intomainfrom
byrichardpowell wants to merge 4 commits intomainfrom
Conversation
AppProxyForm (shopify-app-remix), AppProxyLink (shopify-app-remix), and AppProxyLink (shopify-app-react-router) were plain function components, making it impossible to pass a ref to the underlying DOM element. Wrap all three with forwardRef so consumers can do things like form.current.submit() or anchor.current.focus(). Fixes #1605 Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
- Add forwardRef test to AppProxyForm (shopify-app-remix) - Add forwardRef tests to AppProxyLink in both shopify-app-remix and shopify-app-react-router - Replace combined changeset with per-package changesets listing each affected component Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
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 #1605
AppProxyFormandAppProxyLinkwere plain function components with no ref forwarding, making it impossible for consumers to attach a ref to the underlying DOM element. This PR wraps all three affected components withforwardRef:AppProxyFormin@shopify/shopify-app-remix— forwardsrefto the underlying Remix<Form>/<form>elementAppProxyLinkin@shopify/shopify-app-remix— forwardsrefto the underlying<a>elementAppProxyLinkin@shopify/shopify-app-react-router— forwardsrefto the underlying<a>elementNote:
RemixPolarisLinkalready usedforwardRefcorrectly and was not changed.Motivation
Without
forwardRef, TypeScript raises:and consumers cannot do common DOM operations like
form.current.submit()oranchor.current.focus().Test plan
pnpm testinshopify-app-remixandshopify-app-react-router)refprop onAppProxyFormandAppProxyLinkwithout errorsref.currentcorrectly points to the underlying DOM element at runtime🤖 Generated with Claude Code