@plasmicapp/react-web 0.2.305 → 0.2.308

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plasmicapp/react-web",
3
- "version": "0.2.305",
3
+ "version": "0.2.308",
4
4
  "description": "plasmic library for rendering in the presentational style",
5
5
  "main": "dist/index.cjs.js",
6
6
  "types": "dist/index.d.ts",
@@ -90,7 +90,7 @@
90
90
  "@plasmicapp/data-sources": "0.1.143",
91
91
  "@plasmicapp/data-sources-context": "0.1.20",
92
92
  "@plasmicapp/host": "1.0.185",
93
- "@plasmicapp/loader-splits": "1.0.49",
93
+ "@plasmicapp/loader-splits": "1.0.51",
94
94
  "@plasmicapp/prepass": "1.0.13",
95
95
  "@plasmicapp/query": "0.1.77",
96
96
  "@react-aria/checkbox": "^3.11.2",
@@ -157,5 +157,5 @@
157
157
  "react": ">=16.8.0",
158
158
  "react-dom": ">=16.8.0"
159
159
  },
160
- "gitHead": "be71b41ad94d0db53100816e00d1519793409999"
160
+ "gitHead": "9638cc7f1d2af2fbbf9966b4096449e9c82b375b"
161
161
  }
@@ -1342,18 +1342,6 @@ function useDollarState(specs) {
1342
1342
  });
1343
1343
  }
1344
1344
  }
1345
- // For each spec with an initFunc, evaluate it and see if
1346
- // the init value has changed. If so, reset its state.
1347
- var resetSpecs = [];
1348
- getStateCells($state, $$state.rootSpecTree).forEach(function (stateCell) {
1349
- var _a;
1350
- if (stateCell.initFunc) {
1351
- var newInit = invokeInitFuncBackwardsCompatible(stateCell.initFunc, __assign({ $state: $state }, ((_a = stateCell.overrideEnv) !== null && _a !== void 0 ? _a : envFieldsAreNonNill(env))));
1352
- if (!deepEqual(newInit, stateCell.initialValue)) {
1353
- resetSpecs.push({ stateCell: stateCell });
1354
- }
1355
- }
1356
- });
1357
1345
  var reInitializeState = function (stateCell) {
1358
1346
  var _a, _b;
1359
1347
  var newInit = initializeStateValue($$state, stateCell, $state);
@@ -1363,11 +1351,23 @@ function useDollarState(specs) {
1363
1351
  }
1364
1352
  };
1365
1353
  useIsomorphicLayoutEffect(function () {
1354
+ // For each spec with an initFunc, evaluate it and see if
1355
+ // the init value has changed. If so, reset its state.
1356
+ var resetSpecs = [];
1357
+ getStateCells($state, $$state.rootSpecTree).forEach(function (stateCell) {
1358
+ var _a;
1359
+ if (stateCell.initFunc) {
1360
+ var newInit = invokeInitFuncBackwardsCompatible(stateCell.initFunc, __assign({ $state: $state }, ((_a = stateCell.overrideEnv) !== null && _a !== void 0 ? _a : envFieldsAreNonNill(env))));
1361
+ if (!deepEqual(newInit, stateCell.initialValue)) {
1362
+ resetSpecs.push({ stateCell: stateCell });
1363
+ }
1364
+ }
1365
+ });
1366
1366
  resetSpecs.forEach(function (_a) {
1367
1367
  var stateCell = _a.stateCell;
1368
1368
  reInitializeState(stateCell);
1369
1369
  });
1370
- }, [env.$props, resetSpecs]);
1370
+ }, [env.$props, $state, $$state, reInitializeState]);
1371
1371
  useIsomorphicLayoutEffect(function () {
1372
1372
  while ($$state.registrationsQueue.length) {
1373
1373
  var _a = $$state.registrationsQueue.shift(), path = _a.path, f = _a.f, overrideEnv = _a.overrideEnv;