x-ui-design 0.4.97 → 0.4.99

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
@@ -1,5 +1,5 @@
1
1
  import require$$1 from 'react/jsx-runtime';
2
- import React, { useRef, useState, useEffect, Children, isValidElement, Fragment, Suspense, useContext, useMemo, forwardRef, createContext, useImperativeHandle, useCallback } from 'react';
2
+ import React, { useRef, useState, Children, isValidElement, Fragment, Suspense, useContext, useMemo, useEffect, forwardRef, createContext, useImperativeHandle, useCallback } from 'react';
3
3
  import { createPortal } from 'react-dom';
4
4
  import ReactDOMServer from 'react-dom/server';
5
5
 
@@ -617,12 +617,6 @@ const useForm = (initialValues = {}, onFieldsChange, onValuesChange, scrollToFir
617
617
  const fieldInstancesRef = useRef({});
618
618
  const [isReseting, setIsReseting] = useState(false);
619
619
  const [errors, setErrors] = useState({});
620
- useEffect(() => {
621
- console.log({
622
- formRef: formRef.current,
623
- stepRef: stepRef.current
624
- });
625
- }, [formRef.current, stepRef.current]);
626
620
  const fieldSubscribers = useRef({});
627
621
  const formSubscribers = useRef([]);
628
622
  function getFormFields() {
@@ -725,7 +719,9 @@ const useForm = (initialValues = {}, onFieldsChange, onValuesChange, scrollToFir
725
719
  delete rulesRef.current[name];
726
720
  delete fieldInstancesRef.current[name];
727
721
  } else {
728
- if (!(name in formRef.current[stepRef.current])) {
722
+ if (!(name in {
723
+ ...formRef.current[stepRef.current]
724
+ })) {
729
725
  formRef.current[stepRef.current][name] = initialValues?.[name];
730
726
  }
731
727
  rulesRef.current[name] = rules;