Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    react-amp-documentpublic

    "AMP Document" React Component

    A lightweight React component that takes an AMP document URL as input and renders it.

    User Guide

    npm install react-amp-document

    ./index.html

    <head>
      <!-- Include AMP runtime with Shadow DOM API. -->
      <script async src="https://cdn.ampproject.org/shadow-v0.js"></script>
    </head>

    ./index.js

    import AMPDocument from 'react-amp-document/amp-document';
     
    // Create an <AMPDocument> and set its `src` prop to an AMP document URL:
    ReactDOM.render(<AMPDocument src="https://ampbyexample.com" />);

    Keywords

    install

    npm i react-amp-document

    Downloadslast 7 days

    9

    version

    0.1.2

    license

    Apache-2.0

    repository

    github.com

    last publish

    collaborators

    • avatar