import { type ControllerProps } from "https://deno.land/x/netzo@0.3.91/deps/react-hook-form.ts";
Render function to provide the control for the field.
Examples
Example 1
Example 1
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 Parameters
optional
TFieldValues extends FieldValues = FieldValuesoptional
TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>definition: { render: (unnamed 0: { field: ControllerRenderProps<TFieldValues, TName>; fieldState: ControllerFieldState; formState: UseFormStateReturn<TFieldValues>; }) => React.ReactElement; } & UseControllerProps<TFieldValues, TName>