Home
Recent Q&A
Java
Cloud
JavaScript
Python
SQL
PHP
HTML
C++
Data Science
DBMS
Devops
Hadoop
Machine Learning
Azure
Blockchain
Devops
Ask a Question
How to use Polymer in React?
Home
ReactJS
How to use Polymer in React?
0
votes
asked
Mar 4, 2020
in
ReactJS
by
JackTerrance
How to use Polymer in React?
Please
log in
or
register
to answer this question.
1
Answer
0
votes
answered
Mar 4, 2020
by
JackTerrance
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
'
}
})
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
'
>
Use that element in the JSX file:
import
React
from
'
react
'
class
MyComponent
extends
React
.
Component
{
render
() {
return
(
<
calender
-
element
/
>
)
}
}
export
default
MyComponent
Your comment on this answer:
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Related questions
0
votes
Q: Catalyst used in catalytic polymerization which produces polymer gasoline is
asked
Oct 16, 2021
in
Petroleum Engineering
by
Robin
gas-injection
petroleum-engineering-questions
petroleum-engineer-interview-questions
petroleum-engineering-mcq
petroleum-engineering-interview-questions
petroleum-engineering-numericals
petroleum-questions-and-answers
objective-questions-in-petroleum-engineering-pdf
petroleum-interview-questions-pdf
0
votes
Q: How to use class field declarations syntax in React classes?
asked
Nov 1, 2023
in
ReactJS
by
AdilsonLima
reactjs-interview-questions-answers
0
votes
Q: How to use innerHTML in React? Explain with Example.
asked
Oct 31, 2023
in
ReactJS
by
AdilsonLima
reactjs-interview-questions-answers
0
votes
Q: How to use TypeScript in create-react-app application?
asked
Feb 24, 2021
in
ReactJS
by
SakshiSharma
#type-script
typescript
type-case
create-react-app
react-application
0
votes
Q: What is the virtual DOM? How does react use the virtual DOM to render the UI?
asked
Dec 8, 2020
in
ReactJS
by
SakshiSharma
#virtual-dom
#use-of-dom
0
votes
Q: How to use Font Awesome icons in React?
asked
Mar 4, 2020
in
ReactJS
by
JackTerrance
0
votes
Q: How to use connect() from React Redux?
asked
Mar 3, 2020
in
ReactJS
by
miceperry
0
votes
Q: How to use <FormattedMessage> as placeholder using React Intl?
asked
Mar 3, 2020
in
ReactJS
by
miceperry
+1
vote
Q: How to use https instead of http in create-react-app?
asked
Mar 2, 2020
in
ReactJS
by
RShastri
0
votes
Q: How to use React label element?
asked
Mar 1, 2020
in
ReactJS
by
RShastri
...