Actions
Custom actions are simply a custom JS functions that can be assigned by editors to button clicks.
Example action
Let's add a very simple action that displays alert
. Registering actions is very similar to registering components. They also have id
, label
and schema:
The real action code should be added to ShopstoryProvider
:
The values defined in the Shopstory sidebar will be passed as props to the AlertAction
function.
The result:
Running React hooks inside of actions
Last updated