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

Function _getWatch

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

Source from the content-addressed store, hash-verified

655 !deepEqual(getValues(), _defaultValues));
656
657 const _getWatch: WatchInternal<TFieldValues> = (
658 names,
659 defaultValue,
660 isGlobal,
661 ) =>
662 generateWatchOutput(
663 names,
664 _names,
665 {
666 ...(_state.mount
667 ? _formValues
668 : isUndefined(defaultValue)
669 ? _defaultValues
670 : isString(names)
671 ? { [names]: defaultValue }
672 : defaultValue),
673 },
674 isGlobal,
675 defaultValue,
676 );
677
678 const _getFieldArray = <TFieldArrayValues>(
679 name: InternalFieldName,

Callers 1

watchFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected