I have a list of elements (Knowledgebase) which I wasnt to render onlyt in the case where one of the roles in the list "roles" is equel to zero. However, it is not renderting anything
In the web-console I can also see the log
react_devtools_backend.js:4061 Warning: validateDOMNesting(...): <tr> cannot appear as a child of <td>.
at tr
at td
at tr
at tbody
at table
at UserList (http://localhost:3000/static/js/bundle.js:3997:91)
at Route (http://localhost:3000/static/js/bundle.js:46456:29)
at Switch (http://localhost:3000/static/js/bundle.js:46658:29)
at Router (http://localhost:3000/static/js/bundle.js:46091:30)
at BrowserRouter (http://localhost:3000/static/js/bundle.js:45712:35)
at App
Code:
<td>
{user.roles.map((role) => {
if (role === "0") {
user.knowledgeBase.map((techField) => (
<tr key={techField}>
<td>{techField}</td>
</tr>
));
}
})}
</td>