@plasmicapp/react-web 0.2.357 → 0.2.358

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.cjs.js CHANGED
@@ -2111,7 +2111,7 @@ function subscribeToValtio($$state, statePath, node) {
2111
2111
  }
2112
2112
  }
2113
2113
  function initializeStateValue($$state, initialStateCell, proxyRoot) {
2114
- var _a, _b, _c;
2114
+ var _a;
2115
2115
  var initialStateName = initialStateCell.node.getSpec().path;
2116
2116
  var stateAccess = new Set();
2117
2117
  $$state.stateInitializationEnv.visited.add(initialStateName);
@@ -2168,16 +2168,12 @@ function initializeStateValue($$state, initialStateCell, proxyRoot) {
2168
2168
  : clonedValue;
2169
2169
  set(proxyRoot, initialStateCell.path, value);
2170
2170
  }
2171
- catch (_d) {
2171
+ catch (_b) {
2172
2172
  // Setting the state to undefined to make sure it gets re-initialized
2173
2173
  // in case it changes values.
2174
2174
  initialStateCell.initialValue = undefined;
2175
2175
  set(proxyRoot, initialStateCell.path, undefined);
2176
2176
  }
2177
- //immediately fire onChange
2178
- if (initialSpec.onChangeProp) {
2179
- (_c = (_b = $$state.env.$props)[initialSpec.onChangeProp]) === null || _c === void 0 ? void 0 : _c.call(_b, initialValue);
2180
- }
2181
2177
  $$state.stateInitializationEnv.visited.delete(initialStateName);
2182
2178
  $$state.stateInitializationEnv.stack.pop();
2183
2179
  return initialValue;
@@ -2518,7 +2514,9 @@ function useDollarState(specs) {
2518
2514
  var spec = node.getSpec();
2519
2515
  if (!spec.isRepeated && spec.type !== "private" && spec.initFunc) {
2520
2516
  var stateCell = getStateCellFrom$StateRoot($state, spec.pathObj);
2521
- initializeStateValue($$state, stateCell, $state);
2517
+ if (stateCell.initialValue === UNINITIALIZED) {
2518
+ initializeStateValue($$state, stateCell, $state);
2519
+ }
2522
2520
  }
2523
2521
  });
2524
2522
  }, []);