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

Function _removeUnmounted

src/logic/createFormControl.ts:638–650  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

636 };
637
638 const _removeUnmounted = () => {
639 for (const name of _names.unMount) {
640 const field: Field = get(_fields, name);
641
642 field &&
643 (field._f.refs
644 ? field._f.refs.every((ref) => !live(ref))
645 : !live(field._f.ref)) &&
646 unregister(name as FieldPath<TFieldValues>);
647 }
648
649 _names.unMount = new Set();
650 };
651
652 const _getDirty: GetIsDirty = (name, data) =>
653 !_options.disabled &&

Callers

nothing calls this directly

Calls 1

unregisterFunction · 0.85

Tested by

no test coverage detected