Typescript useWatch compile error #7413
-
Hi, Problem is in file MyInputComponent.tsx at line 12.
I have tried various modifying of the generic type when calling u usewatch but without success. any idea where the problem might be? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
That's currently not possible without type assertions. #7354 would enable you to do that. Until then you'll have to use type assertions. https://codesandbox.io/s/zen-chaplygin-s6yov?file=/src/MyInputComponent.tsx |
Beta Was this translation helpful? Give feedback.
-
You can make it work without assertions by doing it this way: |
Beta Was this translation helpful? Give feedback.
That's currently not possible without type assertions. #7354 would enable you to do that. Until then you'll have to use type assertions.
https://codesandbox.io/s/zen-chaplygin-s6yov?file=/src/MyInputComponent.tsx