javascript - Why can't I nest a tbody tag inside a div tag with JSX in React? -


i'm react beginner , i'm working on project i'll have form , data gets entered table dynamically populated data user.

my code:

<div>   <tbody>     <tr>       <td>{this.props.somedata}</td>     </tr>     <tr>       <td>{this.props.moredata}</td>     </tr>   </tbody> </div> 

react throwing error: validatedomnesting(...): cannot appear child of div

i tried putting table inside new component , nesting new component have same problem. why jsx not tables inside of divs? there work-around?

your problem html one. make table, table body has inside <table> tag:

<table>   <tbody>   ...   </tbody> ... </table> 

Comments

Popular posts from this blog

What is happening when Matlab is starting a "parallel pool"? -

angular - DownloadURL return null in below code -

php - Cannot override Laravel Spark authentication with own implementation -