Skip to content

Fix missing forwardRef in AppProxyForm and AppProxyLink#3098

Open
byrichardpowell wants to merge 4 commits intomainfrom
fix/appproxyform-forwardref
Open

Fix missing forwardRef in AppProxyForm and AppProxyLink#3098
byrichardpowell wants to merge 4 commits intomainfrom
fix/appproxyform-forwardref

Conversation

@byrichardpowell
Copy link
Contributor

Summary

Fixes #1605

AppProxyForm and AppProxyLink were 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 with forwardRef:

  • AppProxyForm in @shopify/shopify-app-remix — forwards ref to the underlying Remix <Form> / <form> element
  • AppProxyLink in @shopify/shopify-app-remix — forwards ref to the underlying <a> element
  • AppProxyLink in @shopify/shopify-app-react-router — forwards ref to the underlying <a> element

Note: RemixPolarisLink already used forwardRef correctly and was not changed.

Motivation

Without forwardRef, TypeScript raises:

Property 'ref' does not exist on type 'IntrinsicAttributes & AppProxyFormProps'

and consumers cannot do common DOM operations like form.current.submit() or anchor.current.focus().

Test plan

  • Existing tests pass (pnpm test in shopify-app-remix and shopify-app-react-router)
  • TypeScript accepts ref prop on AppProxyForm and AppProxyLink without errors
  • ref.current correctly points to the underlying DOM element at runtime

🤖 Generated with Claude Code

byrichardpowell and others added 2 commits March 13, 2026 12:35
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AppProxyForm does not handle ref attribute

1 participant