Skip to content
Discussion options

You must be logged in to vote

FormProvider receives methods in the hook useForm and it never triggers re-render because of the ref-based implementation while normal React's context makes entries childs re-render if you spread <ReactFormProvider {...form}/>.

Another benefit is react-hook-form's useContext is type-safe

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@ryanhopperlowe
Comment options

@lamhungypl
Comment options

Answer selected by ryanhopperlowe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants