Interactivity API should have a method to access root context when using wp-each directive #65770
sethrubenstein
started this conversation in
Interactivity API
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
What I'm proposing is a new function in the api,
getRootContext
. This would return the context of the current elements root element, so one interactive element up.Take this example of using
wp-each
directive:And consider this view.is
What if there was a
getRootContext
function, that would return the context of the root element? This would be useful for more than just in wp-each, I could see myself using this to get the content of the interactive namespace one element up, and so on (without getting too ridiculous). This would allow a little more broader use of context vs global state.Beta Was this translation helpful? Give feedback.
All reactions