The problem is that there can be multiple menus on the page. So with the action, which one do you want to close? For that reason we need context.
A better pattern would be yo expose a `closeAllMenus()` action hooked to some global state that all menus are listening to, and use that in your block.
16.11.2024 08:59
π 0
π 0
π¬ 1
π 0
That said, I think that focusing on the problems it solves is the best approach when it's the first time people hear about the API, as they can then learn the more technical details later if they are interested.
15.11.2024 20:37
π 0
π 0
π¬ 0
π 0
Server-side rendering: Processing directives on the server β Block Editor Handbook | Developer.WordPress.org
WordPress has always been built on the foundation of server-side rendering. Traditionally, when a user requests a WordPress page, the serverβ¦
That's awesome ππ
One of the questions that seems to repeat itself over and over again is, if WordPress is already using React in the admin, why can't React be used on the frontend?
I have tried to explain it as best as I could in this article: developer.wordpress.org/block-editor...
15.11.2024 20:30
π 1
π 0
π¬ 1
π 0
It seems there's some activity around here, so I just wanted to say that I'm available here as well.
Anyone who needs help with the Interactivity API, just let me know! βΊοΈ
15.11.2024 10:59
π 16
π 2
π¬ 4
π 0