You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
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