TypeError building custom input, Type 'Control<FormValues, any>' is not assignable to type 'Control<FieldValues, any>'. #8806
Unanswered
meotimdihia
asked this question in
Q&A
Replies: 2 comments 5 replies
-
|
Check out this thread #8606 |
Beta Was this translation helpful? Give feedback.
2 replies
-
Same concept, you just need to apply it to the import type {
UseControllerProps,
FieldValues,
FieldPath,
} from 'react-hook-form'
type InputProps<
TFieldValues extends FieldValues,
TName extends FieldPath<TFieldValues>
> = UseControllerProps<TFieldValues, TName>
const Input = React.forwardRef(
<TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues>>(
props: InputProps<TFieldValues, TName>,
ref: Ref<HTMLInputElement>
) => //== Component Logic Here ==//
);P.S. I don't get why you need |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am getting this error with
React 18,Typescript 4.7.4It takes 4 hours for me, but I can't solve it.
the code
https://stackblitz.com/edit/next-typescript-pokptk-wuiput?file=pages%2Findex.tsx
Beta Was this translation helpful? Give feedback.
All reactions