@plasmicapp/react-web 0.2.160 → 0.2.161

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.
@@ -2636,13 +2636,14 @@ function initializeStateValue($$state, initialSpecNode, initialStatePath, proxyR
2636
2636
  var node = _ref.node,
2637
2637
  path = _ref.path;
2638
2638
  node.addListener(path, function () {
2639
- var newValue = initialSpecNode.getSpec().initFunc(_extends({
2639
+ var newValue = invokeInitFuncBackwardsCompatible(initialSpecNode.getSpec().initFunc, _extends({
2640
2640
  $state: $state
2641
2641
  }, $$state.env));
2642
2642
  set(proxyRoot, initialStatePath, newValue);
2643
2643
  });
2644
2644
  });
2645
- var initialValue = initialSpecNode.getInitFunc(initialSpecNode.getState(initialStatePath))(_extends({
2645
+ var initFunc = initialSpecNode.getInitFunc(initialSpecNode.getState(initialStatePath));
2646
+ var initialValue = invokeInitFuncBackwardsCompatible(initFunc, _extends({
2646
2647
  $state: $state
2647
2648
  }, $$state.env));
2648
2649
  initialSpecNode.setInitialValue(initialStatePath, clone(initialValue));
@@ -2818,6 +2819,13 @@ function extractDollarStateParametersBackwardCompatible() {
2818
2819
  };
2819
2820
  }
2820
2821
  }
2822
+ function invokeInitFuncBackwardsCompatible(initFunc, env) {
2823
+ if (initFunc.length > 1) {
2824
+ return initFunc(env.$props, env.$state, env.$ctx);
2825
+ } else {
2826
+ return initFunc(env);
2827
+ }
2828
+ }
2821
2829
  function useDollarState(specs) {
2822
2830
  for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
2823
2831
  rest[_key - 1] = arguments[_key];
@@ -2924,7 +2932,7 @@ function useDollarState(specs) {
2924
2932
  stateCell = _ref3.stateCell;
2925
2933
  var initFunc = node.getInitFunc(stateCell);
2926
2934
  if (initFunc) {
2927
- var newInit = initFunc(_extends({
2935
+ var newInit = invokeInitFuncBackwardsCompatible(initFunc, _extends({
2928
2936
  $state: $state
2929
2937
  }, envFieldsAreNonNill(env)));
2930
2938
  if (!deepEqual(newInit, stateCell.initialValue)) {