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
Uh oh!
There was an error while loading. Please reload this page.
-
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-templatenpx @wordpress/create-block@latest block-2 --template @wordpress/create-block-interactive-templateI 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 alwaysundefinedMy block-2 view.js example:
Any particular reason why this would return
undefined?Beta Was this translation helpful? Give feedback.
All reactions