react-hook-form 6.15.5-beta.0 → 6.15.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -619,9 +619,7 @@
619
619
  return observer;
620
620
  }
621
621
 
622
- var isWeb = typeof window !== UNDEFINED &&
623
- typeof window.HTMLElement !== UNDEFINED &&
624
- typeof document !== UNDEFINED;
622
+ var isWeb = typeof window !== UNDEFINED && typeof document !== UNDEFINED;
625
623
 
626
624
  function cloneObject(data) {
627
625
  var _a;
@@ -1517,7 +1515,7 @@
1517
1515
  : getDefaultValues(defaultValuesRef.current)),
1518
1516
  ]);
1519
1517
  const [fields, setFields] = React.useState(mapIds(memoizedDefaultValues.current, keyName));
1520
- set(fieldArrayValuesRef.current, name, fields);
1518
+ set(fieldArrayValuesRef.current, name, compact(fields));
1521
1519
  const omitKey = (fields) => fields.map((_a = {}) => {
1522
1520
  var _b = keyName, omitted = _a[_b], rest = __rest(_a, [typeof _b === "symbol" ? _b : _b + ""]);
1523
1521
  return rest;
@@ -1729,7 +1727,7 @@
1729
1727
  append: React.useCallback(append, [name]),
1730
1728
  remove: React.useCallback(remove, [name]),
1731
1729
  insert: React.useCallback(insert$1, [name]),
1732
- fields,
1730
+ fields: compact(fields),
1733
1731
  };
1734
1732
  };
1735
1733