MCPcopy
hub / github.com/react-hook-form/react-hook-form / _getWatch

Function _getWatch

src/logic/createFormControl.ts:745–764  ·  view source on GitHub ↗
(
    names,
    defaultValue,
    isGlobal,
  )

Source from the content-addressed store, hash-verified

743 !deepEqual(_state.mount ? _formValues : _defaultValues, _defaultValues));
744
745 const _getWatch: WatchInternal<TFieldValues> = (
746 names,
747 defaultValue,
748 isGlobal,
749 ) =>
750 generateWatchOutput(
751 names,
752 _names,
753 {
754 ...(_state.mount
755 ? _formValues
756 : isUndefined(defaultValue)
757 ? _defaultValues
758 : isString(names)
759 ? { [names]: defaultValue }
760 : defaultValue),
761 },
762 isGlobal,
763 defaultValue,
764 );
765
766 const _getFieldArray = <TFieldArrayValues>(
767 name: InternalFieldName,

Callers 1

watchFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…