MCPcopy Create free account
hub / github.com/react-hook-form/react-hook-form / _focusInput

Function _focusInput

src/logic/createFormControl.ts:1001–1007  ·  view source on GitHub ↗
(ref: Ref, key: string)

Source from the content-addressed store, hash-verified

999 };
1000
1001 const _focusInput = (ref: Ref, key: string) => {
1002 if (get(_formState.errors, key) && ref.focus) {
1003 ref.focus();
1004 return 1;
1005 }
1006 return;
1007 };
1008
1009 const trigger: UseFormTrigger<TFieldValues> = async (name, options = {}) => {
1010 let isValid;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected