REACT ERROR <th> cannot appear as a child of <thead>. See (unknown) > thead > th
The only direct children allowed for thead
are tr
elements, not th
.
<table> <thead> <tr> <th /> </tr> </thead> ...</table>
Well th
should be nested under a tr
not a thead
. Docs
<table> <thead> <tr> <th>name</th> <th>age</th> </tr> </thead> <tbody> <tr> <td>john</td> <td>33</td> </tr> <tr> <td>smith</td> <td>22</td> </tr> <tr> <td>jane</td> <td>24</td> </tr> </tbody></table>
Mistakenly, I had tbody
inside thead
(1)
<thead>... <tbody> ... </tbody></thead>
instead of (2)
<thead>...</thead><tbody>...</tbody>
Changing to (2) solved my problem.