diff --git a/packages/client/src/state/stateManager.js b/packages/client/src/state/stateManager.js index 3b625157f5..71bcbe33b5 100644 --- a/packages/client/src/state/stateManager.js +++ b/packages/client/src/state/stateManager.js @@ -189,14 +189,14 @@ const _setup = ( binding.fallback, binding.source ) - } - + } + if (isBound && binding.source === "context") { initialProps[propName] = !context ? propValue : getState(context, binding.path, binding.fallback, binding.source) - } - + } + if (isEventType(propValue)) { const handlersInfos = [] for (let event of propValue) { @@ -211,20 +211,18 @@ const _setup = ( if (!paramBinding) { resolvedParams[paramName] = () => paramValue continue - } + } - let paramValueSource; + let paramValueSource - if (paramBinding.source === "context") paramValueSource = context; - if (paramBinding.source === "state") paramValueSource = getCurrentState(); - if (paramBinding.source === "context") paramValueSource = context; + if (paramBinding.source === "context") paramValueSource = context + if (paramBinding.source === "state") + paramValueSource = getCurrentState() + if (paramBinding.source === "context") paramValueSource = context // The new dynamic event parameter bound to the relevant source - resolvedParams[paramName] = () => getState( - paramValueSource, - paramBinding.path, - paramBinding.fallback - ); + resolvedParams[paramName] = () => + getState(paramValueSource, paramBinding.path, paramBinding.fallback) } handlerInfo.parameters = resolvedParams @@ -260,4 +258,4 @@ const makeHandler = (handlerTypes, handlerInfo) => { } handlerType.execute(parameters) } -} \ No newline at end of file +}