React question detail
How to use Polymer in React?
You need to follow below steps to use Polymer in React,
- Create a Polymer element:
<link
rel="import"
href="../../bower_components/polymer/polymer.html"
/>;
Polymer({
is: "calendar-element",
ready: function () {
this.textContent = "I am a calendar";
},
});
- Create the Polymer component HTML tag by importing it in a HTML document, e.g. import it in the
index.htmlof your React application:
<link
rel="import"
href="./src/polymer-components/calendar-element.html"
/>
- Use that element in the JSX file:
export default function MyComponent {
return <calendar-element />;
}