Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add code requirements for using the Interactivity API on any block #52929

Closed
juanmaguitar opened this issue Jul 25, 2023 · 1 comment
Closed
Assignees
Labels
[Feature] Interactivity API API to add frontend interactivity to blocks. [Type] Developer Documentation Documentation for developers

Comments

@juanmaguitar
Copy link
Contributor

juanmaguitar commented Jul 25, 2023

The following requirements should be added to Requirements of the Interactivity API

  • Add "supports": { "interactivity": true } to block.json
  • Add the data-wp-interactive directive to the main DOM element
    • To indicate to the Interactivity API "engine" to hydrate this dom element and its children

These requirements are already covered when creating an interactive block using @wordpress/create-block-interactive-template but they should be added to the docs for blocks not created with this template that want to start using the Interactivity API.

cc: @luisherranz

@juanmaguitar juanmaguitar added [Type] Developer Documentation Documentation for developers [Feature] Interactivity API API to add frontend interactivity to blocks. labels Jul 25, 2023
@juanmaguitar juanmaguitar self-assigned this Jul 25, 2023
@juanmaguitar juanmaguitar changed the title Add to the requirements of the Interactivity API Add code requirements for using the Interactivity API on any block Jul 25, 2023
@juanmaguitar
Copy link
Contributor Author

Closing issue as per #53342 & #53362

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Interactivity API API to add frontend interactivity to blocks. [Type] Developer Documentation Documentation for developers
Projects
None yet
Development

No branches or pull requests

1 participant