reactjs - Why does React strangely render the <p> (paragraph) tag? -


react doing strange things <p> tag. using same markup structure, <p> tag vs <div> tag produces different results. example,

var withp = (     <p>       withp       <div />     </p> );  var withdiv = (     <div>       withdiv       <div />     </div> ); 

here generated markup looks in chrome:

screenshot chrome dev tools

here live jsbin demo.

why react render <p> differently <div>?

<p> can not have nested block elements. chrome (not react) transforming markup make valid.


Comments

Popular posts from this blog

css - SVG using textPath a symbol not rendering in Firefox -

Java 8 + Maven Javadoc plugin: Error fetching URL -

order - Notification for user in user account opencart -