-
Notifications
You must be signed in to change notification settings - Fork 7
-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No support to update controller render props #15
Comments
gik-hub
changed the title
v7/update-controller-render-props
No support to update controller render props
May 2, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is your feature request related to a problem? Please describe.
I am migrating from react hook form v6 to v7 and need to migrate the controller render prop implementation which I had not seen present in the codemod
<Controller control={control} name="test" render={( { onChange, onBlur, value, name, ref }, { invalid, isTouched, isDirty } ) => ( <Checkbox onBlur={onBlur} onChange={(e) => onChange(e.target.checked)} checked={value} inputRef={ref} /> )} />
Describe the solution you'd like
I would like to have a solution which can convert the v6 syntax above to the one in v7 as share below:
<Controller control={control} name="test" render={({ field: { onChange, onBlur, value, name, ref }, fieldState: { invalid, isTouched, isDirty, error }, formState, }) => ( <Checkbox onBlur={onBlur} // notify when input is touched onChange={onChange} // send value to hook form checked={value} inputRef={ref} /> )} />
Describe alternatives you've considered
Additional context
The text was updated successfully, but these errors were encountered: