Directory

← Back

polymer-react

Use React in Polymer 3 elements.

Author

Rating

Popularity

<100

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)

Compatibility

(Loading compatibility data...)

Was this helpful? Need more help?
Leave a comment or a question below. You can also join the chat on Discord or ask questions on StackOverflow.

Version

Dependencies

  • @polymer/polymer#^3.0.5
  • react#^16.4.2
  • react-dom#^16.4.2
Released
2018-08-27
Maturity
IMPORTED
License
MIT License

Compatibility

Framework
Polymer 3.0+
Browser
Browser Independent

polymer-react - Vaadin Add-on Directory

Use React in Polymer 3 elements. polymer-react - Vaadin Add-on Directory
# polymer-react [![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/polymer-react) [![npm version](https://badge.fury.io/js/polymer-react.svg)](https://badge.fury.io/js/polymer-react) Use React in Polymer 3 elements. ## Usage ```javascript 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``` ``` } render (props) { return } } customElements.define('pr-example', PRExample) ```
Online