Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/netzo/deps/react-hook-form.ts>UseFormSetFocus

Full-stack Deno framework for building business web apps like internal tools, dashboards, admin panels and automated workflows.
Go to Latest
type alias UseFormSetFocus
import { type UseFormSetFocus } from "https://deno.land/x/netzo@0.5.66/deps/react-hook-form.ts";

Set focus on a registered field. You can start to invoke this method after all fields are mounted to the DOM.

Examples

Example 1

useEffect(() => {
  setFocus("name");
}, [setFocus])
// shouldSelect allows to select input's content on focus
<button onClick={() => setFocus("name", { shouldSelect: true })}>Focus</button>

Type Parameters

TFieldValues extends FieldValues
definition: <TFieldName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>(name: TFieldName, options?: SetFocusOptions) => void