Skip to content

Used React.ComponentProps for getting FormField props but getting weird ts error in FormField's control prop when passing form.control to control prop #10567

Answered by leapful
homocodian asked this question in Q&A
Discussion options

You must be logged in to vote

@Ashish-singh-dev

You must pass generic field values type to your TextInputProps in order to infer the type of form.control.

Working demo: https://stackblitz.com/edit/stackblitz-starters-2acueq?file=pages%2Findex.tsx,components%2Ftext-input.tsx

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by homocodian
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