Skip to content

[compiler]: add useFormContext to react-hook-form known incompatible APIs#36438

Open
tatsuya-asami wants to merge 1 commit intofacebook:mainfrom
tatsuya-asami:compiler-react-hook-form-useformcontext-watch
Open

[compiler]: add useFormContext to react-hook-form known incompatible APIs#36438
tatsuya-asami wants to merge 1 commit intofacebook:mainfrom
tatsuya-asami:compiler-react-hook-form-useformcontext-watch

Conversation

@tatsuya-asami
Copy link
Copy Markdown

#34027 added a check for react-hook-form's useForm().watch, but not for useFormContext().watch. useFormContext() exposes the same watch function: when React Compiler memoizes calls to it, the watched value goes stale and form updates are not reflected in the UI.

This PR mirrors the existing useForm rule onto useFormContext so the compiler skips memoization in this case as well, also discussed in the community.

…e APIs

facebook#34027 added a check for react-hook-form's `useForm().watch`, but not
`useFormContext().watch`. The same `watch` function is exposed via
`useFormContext()` and has the same memoization incompatibility, also
discussed in the community at
https://github.com/orgs/react-hook-form/discussions/12524.
@meta-cla meta-cla Bot added the CLA Signed label May 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant