Skip to content

useForm fails with "React is null" during tests using Vitest (React 19 + Vite) #12820

Closed Answered by felipecoders
felipecoders asked this question in Q&A
Discussion options

You must be logged in to vote

Closed: The issue was related to React Hook Form's context. I needed to create a subcomponent directly in the test to wrap the useForm call, even though it was already used inside another component. This resolved the error.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by felipecoders
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant