@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.
@@ -2641,13 +2641,14 @@ function initializeStateValue($$state, initialSpecNode, initialStatePath, proxyR
2641
2641
  var node = _ref.node,
2642
2642
  path = _ref.path;
2643
2643
  node.addListener(path, function () {
2644
- var newValue = initialSpecNode.getSpec().initFunc(_extends({
2644
+ var newValue = invokeInitFuncBackwardsCompatible(initialSpecNode.getSpec().initFunc, _extends({
2645
2645
  $state: $state
2646
2646
  }, $$state.env));
2647
2647
  set(proxyRoot, initialStatePath, newValue);
2648
2648
  });
2649
2649
  });
2650
- var initialValue = initialSpecNode.getInitFunc(initialSpecNode.getState(initialStatePath))(_extends({
2650
+ var initFunc = initialSpecNode.getInitFunc(initialSpecNode.getState(initialStatePath));
2651
+ var initialValue = invokeInitFuncBackwardsCompatible(initFunc, _extends({
2651
2652
  $state: $state
2652
2653
  }, $$state.env));
2653
2654
  initialSpecNode.setInitialValue(initialStatePath, clone(initialValue));
@@ -2823,6 +2824,13 @@ function extractDollarStateParametersBackwardCompatible() {
2823
2824
  };
2824
2825
  }
2825
2826
  }
2827
+ function invokeInitFuncBackwardsCompatible(initFunc, env) {
2828
+ if (initFunc.length > 1) {
2829
+ return initFunc(env.$props, env.$state, env.$ctx);
2830
+ } else {
2831
+ return initFunc(env);
2832
+ }
2833
+ }
2826
2834
  function useDollarState(specs) {
2827
2835
  for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
2828
2836
  rest[_key - 1] = arguments[_key];
@@ -2929,7 +2937,7 @@ function useDollarState(specs) {
2929
2937
  stateCell = _ref3.stateCell;
2930
2938
  var initFunc = node.getInitFunc(stateCell);
2931
2939
  if (initFunc) {
2932
- var newInit = initFunc(_extends({
2940
+ var newInit = invokeInitFuncBackwardsCompatible(initFunc, _extends({
2933
2941
  $state: $state
2934
2942
  }, envFieldsAreNonNill(env)));
2935
2943
  if (!deepEqual(newInit, stateCell.initialValue)) {