Skip to content

d4l3k/polymer-react

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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