ampproject / ampproject/amp-react-prototype

Exporter

Open
#52 2 comments 0 reactions 0 assignees View on GitHub
TBD
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.