Replies: 1 comment 4 replies
-
Try using import type { FieldPath, FieldValues } from "react-hook-form"
type InputProps<TFieldValues extends FieldValues> = {
fieldPath: FieldPath<TFieldValues>
} |
Beta Was this translation helpful? Give feedback.
4 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.
-
Hi all,
I am having an issue that wasn't present before in regards to the
<Controller />
component. I have the following interface (name is simplified) that used to work:And the form component is as follows:
It would be called like this:
The above worked fine; however, after running a babel update from
v7.20.5
tov7.20.7
, there was a dependency that was missing --@babel/helper-remap-async-to-generator
-- and this was installed.After getting that yarn problem resolved, the type of
fieldName
has changed fromPath<TFieldValues>
toPath<UnPackAsyncDefaultValues<TFieldValues>>
and I am no longer able to call the<Input />
component withfieldName
as a string now.Type 'string' is not assignable to type 'Path<UnPackAsyncDefaultValue<TFieldValues>>'
.I was wondering if anyone has seen this issue before, and is there a way to pass in a string still as the field name?
Beta Was this translation helpful? Give feedback.
All reactions