Narcoleptic Programmers' Medicine

    polymer-react
    TypeScript icon, indicating that this package has built-in type declarations

    1.0.1 • Public • Published

    polymer-react Published on webcomponents.org npm version

    Use React in Polymer 3 elements.

    Usage

    import {PolymerElement, html} from '@polymer/polymer/polymer-element.js'
    import React from 'react'
    
    import 'polymer-react'
    
    export class PRExample extends PolymerElement {
      const props = {
        bar: 10
      }
    
      static get template () {
        return html```
          <polymer-react render="[[render]]" props="[[props]]"></polymer-react>
        ```
      }
    
      render (props) {
        return <YourReactElement foo={props.bar}></YourReactElement>
      }
    }
    
    customElements.define('pr-example', PRExample)

    Keywords

    none

    Install

    npm i polymer-react

    DownloadsWeekly Downloads

    1

    Version

    1.0.1

    License

    MIT

    Unpacked Size

    7.05 kB

    Total Files

    12

    Last publish

    Collaborators

    • d4l3k