Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

ControllerProps

Render function to provide the control for the field.

@example
const { field, fieldState, formState } = useController();

<Controller
  render={({ field, formState, fieldState }) => ({
    <input
      onChange={field.onChange}
      onBlur={field.onBlur}
      name={field.name}
      ref={field.ref} // optional for focus management
    />
  })}
/>
type ControllerProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = {
render: ({ field, fieldState, formState }: {
field: ControllerRenderProps<TFieldValues, TName>;
fieldState: ControllerFieldState;
formState: UseFormStateReturn<TFieldValues>;
}
) => React.ReactElement
;
}
& UseControllerProps<TFieldValues, TName>;

§Type Parameters

§
TFieldValues extends FieldValues = FieldValues
[src]
§
TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>
[src]

§Type

§
{
render: ({ field, fieldState, formState }: {
field: ControllerRenderProps<TFieldValues, TName>;
fieldState: ControllerFieldState;
formState: UseFormStateReturn<TFieldValues>;
}
) => React.ReactElement
;
}
& UseControllerProps<TFieldValues, TName>
[src]