N
N
noneim2018-02-03 01:01:40
React
noneim, 2018-02-03 01:01:40

What is the correct way to use custom element inside react?

Custom elements are of two types:

<!-- variant 1 -->
<my-tag></my-tag>
<!-- variant 2 -->
<div is="my-tag"></div>

So, why does the second option not work in react16?
<!-- работает в 15, не работает в 16 -->
<div is="chart-01" data-stars="0;1;2;3;4;5"></div>
<!-- работает и в 15 и в 16 -->
<chart-02 data-stars="5;4;3;2;1"></chart-02>

React15 example (codepen) React16
example (codepen)

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question