amphtml-tsx
TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

amphtml-tsx

Transform tsx to AMP HTML string

Setup

tsconfig.json

{
  "compilerOptions": {
    "jsx": "react",
    "jsxFactory": "pragma"
  }
}

Usage

import { pragma } from 'amphtml-tsx'
 
const renderToString = (name: string) => (
  <div class="one two three">
    <p id="line">
      Hello, {name}!
    </p>
  </div>
)
 
console.log(renderToString('world'))
// => <div class="one two three"><p id="line">Hello, world!</p></div>

Dependencies (0)

    Dev Dependencies (12)

    Package Sidebar

    Install

    npm i amphtml-tsx

    Weekly Downloads

    0

    Version

    1.1.1

    License

    MIT

    Unpacked Size

    8.2 kB

    Total Files

    10

    Last publish

    Collaborators

    • progfay