Luis Herranz
banner
luisherranz.bsky.social
Luis Herranz
@luisherranz.bsky.social
Designing the WordPress Interactivity API - Previously at Frontity.org
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.
November 16, 2024 at 8:59 AM
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.
November 15, 2024 at 8:37 PM
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...
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…
developer.wordpress.org
November 15, 2024 at 8:30 PM