Skip to content

Latest commit

 

History

History
36 lines (25 loc) · 1.01 KB

README.md

File metadata and controls

36 lines (25 loc) · 1.01 KB

polymer-react Published on webcomponents.org npm version Build Status

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)

License

polymer-react is licensed under the MIT license.

Copyright (c) Tristan Rice 2018