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.
package/dist/index.esm.js CHANGED
@@ -615,9 +615,7 @@ function onDomRemove(fieldsRef, removeFieldEventListenerAndRef) {
615
615
  return observer;
616
616
  }
617
617
 
618
- var isWeb = typeof window !== UNDEFINED &&
619
- typeof window.HTMLElement !== UNDEFINED &&
620
- typeof document !== UNDEFINED;
618
+ var isWeb = typeof window !== UNDEFINED && typeof document !== UNDEFINED;
621
619
 
622
620
  function cloneObject(data) {
623
621
  var _a;
@@ -1514,7 +1512,7 @@ const useFieldArray = ({ control, name, keyName = 'id', }) => {
1514
1512
  : getDefaultValues(defaultValuesRef.current)),
1515
1513
  ]);
1516
1514
  const [fields, setFields] = useState(mapIds(memoizedDefaultValues.current, keyName));
1517
- set(fieldArrayValuesRef.current, name, fields);
1515
+ set(fieldArrayValuesRef.current, name, compact(fields));
1518
1516
  const omitKey = (fields) => fields.map((_a = {}) => {
1519
1517
  var _b = keyName, omitted = _a[_b], rest = __rest(_a, [typeof _b === "symbol" ? _b : _b + ""]);
1520
1518
  return rest;
@@ -1726,7 +1724,7 @@ const useFieldArray = ({ control, name, keyName = 'id', }) => {
1726
1724
  append: useCallback(append, [name]),
1727
1725
  remove: useCallback(remove, [name]),
1728
1726
  insert: useCallback(insert$1, [name]),
1729
- fields,
1727
+ fields: compact(fields),
1730
1728
  };
1731
1729
  };
1732
1730