Skip to content

useIsBlurred

useIsBlurred subscribes to the blur state of a field. It will only trigger a rerender when the status changes.

Blur is defined as when a field loses focus.

The blur state does not propagate to any parent fields. Blurring a subfield of an object does not apply blur to the parent object, and blurring an array element does not blur the entire array.

const form = useForm({
initialValues: { username: "admin" }
});
const isBlurred: boolean = useIsBlurred(form("username"));
function useIsBlurred(field: FormField<any>): boolean