Most of AMP elements have standard "public" state, including:
isBuilt
isLoaded
loadedPromise
etc
And also AMP elements have some imperative APIs such as:
executeAction
unlayout
pause/resume
The two questions are:
How to export these APIs to AMP framework.
Whether and how to export these APIs to React layer.
For imperative API exporting we can use forwardRef and useImperativeHandle. We need to be careful with such APIs however - changing their shape has to follow backward-compatibility rules.
Most of AMP elements have standard "public" state, including:
And also AMP elements have some imperative APIs such as:
The two questions are:
For imperative API exporting we can use forwardRef and useImperativeHandle. We need to be careful with such APIs however - changing their shape has to follow backward-compatibility rules.