Skip to content
This repository was archived by the owner on Oct 23, 2024. It is now read-only.

Commit c6aaeca

Browse files
committed
Inherit root state when rendering a <Symbol /> component
The issue we were having: When a symbol component is being created, it can reference the `bindings` of the page it's on. However, when the symbol is actually inserted in the page, the bindings can no longer be referenced. This is because the root state of the application wasn't being passed down to the symbol. We pass our custom bindings to the builder component we render, and all child components use those bindings from the page's root state. However, when the boundary between a page and a symbol is crossed, those bindings weren't being passed down.
1 parent 10d3ad6 commit c6aaeca

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

packages/sdks/src/blocks/symbol/symbol.lite.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ export default function Symbol(props: SymbolProps) {
109109
}}
110110
customComponents={Object.values(props.builderComponents)}
111111
data={{
112+
...props.builderContext.value.rootState,
112113
...props.symbol?.data,
113114
...props.builderContext.value.localState,
114115
...state.contentToUse?.data?.state,

0 commit comments

Comments
 (0)