You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
gik-hub
changed the title
v7/update-controller-render-props
No support to update controller render props
May 2, 2024
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: