@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.mjs CHANGED
@@ -376,6 +376,7 @@ function useValidation() {
376
376
  function useOptionalValidation() {
377
377
  return useContext3(ValidationContext);
378
378
  }
379
+ var useIsomorphicLayoutEffect = typeof document !== "undefined" ? React2.useLayoutEffect : React2.useEffect;
379
380
  function useFieldValidation(path, config) {
380
381
  const {
381
382
  fieldStates,
@@ -388,7 +389,7 @@ function useFieldValidation(path, config) {
388
389
  const configKey = config === void 0 ? void 0 : JSON.stringify(config);
389
390
  const configRef = React2.useRef(config);
390
391
  configRef.current = config;
391
- React2.useEffect(() => {
392
+ useIsomorphicLayoutEffect(() => {
392
393
  const current = configRef.current;
393
394
  if (path && current) {
394
395
  registerField(path, current);