ampproject / ampproject/amp-react-prototype
Exporter
- Dominant language
- JavaScript
- Stars
- 36
- Forks
- 6
- PR merge metrics
- No merged PRs in 30d
Description
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:
1. How to export these APIs to AMP framework.
2. Whether and how to export these APIs to React layer.
For imperative API exporting we can use [forwardRef](https://reactjs.org/docs/forwarding-refs.html) and [useImperativeHandle](https://reactjs.org/docs/hooks-reference.html#useimperativehandle). We need to be careful with such APIs however - changing their shape has to follow backward-compatibility rules.
Contributor guide
Assessment
This issue has not been assessed yet.