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

Commit

Permalink
Inherit root state when rendering a <Symbol /> component
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
x1024 committed Jul 18, 2024
1 parent 10d3ad6 commit c6aaeca
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/sdks/src/blocks/symbol/symbol.lite.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ export default function Symbol(props: SymbolProps) {
}}
customComponents={Object.values(props.builderComponents)}
data={{
...props.builderContext.value.rootState,
...props.symbol?.data,
...props.builderContext.value.localState,
...state.contentToUse?.data?.state,
Expand Down

0 comments on commit c6aaeca

Please sign in to comment.