Replies: 1 comment
-
How did you define the context of your block? Could you share the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Great job on Interactivity API so far!
I'm trying a proof of concept where I can access another block's context. I initialize two blocks with:
npx @wordpress/create-block@latest block-1 --template @wordpress/create-block-interactive-template
npx @wordpress/create-block@latest block-2 --template @wordpress/create-block-interactive-template
I give their stores different names and try basic functions for each, everything is working fine there.
However, when I try to access block-1 context from block-2 eg.
const anotherBlockContext = getContext('block-1')
I get alwaysundefined
My block-2 view.js example:
Any particular reason why this would return
undefined
?Beta Was this translation helpful? Give feedback.
All reactions