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 }: {
} & UseControllerProps<TFieldValues, TName>;field: ControllerRenderProps<TFieldValues, TName>;
fieldState: ControllerFieldState;
formState: UseFormStateReturn<TFieldValues>;
}) => React.ReactElement; §Type Parameters
§
TFieldValues extends FieldValues = FieldValues
[src]§Type
§
{
[src]render: ({ field, fieldState, formState }: {
} & UseControllerProps<TFieldValues, TName>field: ControllerRenderProps<TFieldValues, TName>;
fieldState: ControllerFieldState;
formState: UseFormStateReturn<TFieldValues>;
}) => React.ReactElement;