0 votes
in ReactJS by

How to use Polymer in React?

1 Answer

0 votes
by
  1. Create a Polymer element:

    <link rel='import' href='../../bower_components/polymer/polymer.html' />
    Polymer({
      is: 'calender-element',
      ready: function() {
        this.textContent = 'I am a calender'
      }
    })

  2. Create the Polymer component HTML tag by importing it in a HTML document, e.g. import it in the index.html of your React application:

    <link rel='import' href='./src/polymer-components/calender-element.html'>

    1. Use that element in the JSX file:

    import React from 'react'

    class MyComponent extends React.Component {
      render() {
        return (
          <calender-element />
        )
      }
    }

    export default MyComponent

Related questions

0 votes
asked Dec 8, 2020 in ReactJS by SakshiSharma
0 votes
asked Mar 1, 2020 in ReactJS by RShastri
...