Skip to content

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

@juanmaguitar

Description

@juanmaguitar

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions