[compiler] Add useFormContext to known incompatible libraries - #35465
[compiler] Add useFormContext to known incompatible libraries#35465reyronald wants to merge 2 commits into
Conversation
The original implementation in react#34027 added useForm from react-hook-form to the known incompatible libraries list, but missed useFormContext. useFormContext returns the same API surface as useForm, including the watch() function that cannot be memoized safely. This PR adds useFormContext with the same configuration as useForm I repurposed @Maxou44 's original repro repo from react#11910 to demonstrate that the issue can be reproduced with useFormContext too, you can play around with the updated demo if you want to confirm, repo link below https://github.com/reyronald/issue-react-compiler-react-hook-form
|
Can you try using the beta 8.0.0 of React Hook Form ? |
@Maxou44 Issue cannot be reproduced in $ npm ls react-hook-form
└── react-hook-form@8.0.0-beta.0
However, it doesn't seem like the linter takes into account the version of the library, just its name, so it's worth adding regardless, thoughts? |
|
I don't have any issues using 8.0.0, I don't know how the React team want to handle this case 😅 |
|
This pull request has been automatically marked as stale. If this pull request is still relevant, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize reviewing it yet. Your contribution is very much appreciated. |
|
Closing this pull request after a prolonged period of inactivity. If this issue is still present in the latest release, please ask for this pull request to be reopened. Thank you! |
|
Issue is still present |

The original implementation in #34027 added useForm from react-hook-form to the known incompatible libraries list, but missed useFormContext. useFormContext returns the same API surface as useForm, including the watch() function that cannot be memoized safely.
This PR adds useFormContext with the same configuration as useForm
I repurposed @Maxou44 's original repro repo from react-hook-form/react-hook-form#11910 to demonstrate that the issue can be reproduced with useFormContext too, you can play around with the updated demo if you want to confirm, repo link below
https://github.com/reyronald/issue-react-compiler-react-hook-form
Repro details
References
@tanstack/react-virtualto known incompatible libraries #34493