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

Function reset

src/logic/createFormControl.ts:1635–1641  ·  view source on GitHub ↗
(formValues, keepStateOptions)

Source from the content-addressed store, hash-verified

1633 };
1634
1635 const reset: UseFormReset<TFieldValues> = (formValues, keepStateOptions) =>
1636 _reset(
1637 isFunction(formValues)
1638 ? (formValues as Function)(_formValues as TFieldValues)
1639 : formValues,
1640 { ..._options.resetOptions, ...keepStateOptions },
1641 );
1642
1643 const setFocus: UseFormSetFocus<TFieldValues> = (name, options = {}) => {
1644 const field = get(_fields, name);

Callers 15

_resetDefaultValuesFunction · 0.85
FieldArrayFunction · 0.85
AppFunction · 0.85
ComponentFunction · 0.85
TestFunction · 0.85
AppFunction · 0.85
ComponentFunction · 0.85
AppFunction · 0.85
ComponentFunction · 0.85
handleClickFunction · 0.85
FieldArrayFunction · 0.85
AppFunction · 0.85

Calls 1

_resetFunction · 0.85

Tested by 15

FieldArrayFunction · 0.68
AppFunction · 0.68
ComponentFunction · 0.68
TestFunction · 0.68
AppFunction · 0.68
ComponentFunction · 0.68
AppFunction · 0.68
ComponentFunction · 0.68
handleClickFunction · 0.68
FieldArrayFunction · 0.68
AppFunction · 0.68
AppFunction · 0.68