Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

p cannot appear as a descendant of p react

The warning tells you what exactly you need to do. You cannot nest <p> tags and hence use div for the outer tag like

<div>
   {this.state.error && 
      <p className="errorText">
           {this.state.error}
       </p>
   }
</div> 
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #descendant #react
ADD COMMENT
Topic
Name
6+8 =