Skip to content

No support to update controller render props #15

@gik-hub

Description

@gik-hub

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions