@xmachines/json-render-react 0.20.0-xm.1 → 0.20.0-xm.2

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.js CHANGED
@@ -399,6 +399,7 @@ function useValidation() {
399
399
  function useOptionalValidation() {
400
400
  return (0, import_react3.useContext)(ValidationContext);
401
401
  }
402
+ var useIsomorphicLayoutEffect = typeof document !== "undefined" ? import_react3.default.useLayoutEffect : import_react3.default.useEffect;
402
403
  function useFieldValidation(path, config) {
403
404
  const {
404
405
  fieldStates,
@@ -411,7 +412,7 @@ function useFieldValidation(path, config) {
411
412
  const configKey = config === void 0 ? void 0 : JSON.stringify(config);
412
413
  const configRef = import_react3.default.useRef(config);
413
414
  configRef.current = config;
414
- import_react3.default.useEffect(() => {
415
+ useIsomorphicLayoutEffect(() => {
415
416
  const current = configRef.current;
416
417
  if (path && current) {
417
418
  registerField(path, current);