Skip to content

Custom Input: Best way to pass register and error #1864

Answered by bluebill1049
SrBrahma asked this question in Q&A
Discussion options

You must be logged in to vote

<Input name="name" icon={FiUser} placeholder="Nome" aaa={bbb} />

you will have to useFormContext and register the input inside your component.

https://react-hook-form.com/api#useFormContext

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by SrBrahma
Comment options

You must be logged in to vote
1 reply
@SrBrahma
Comment options

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