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
Post a Comment