React table Whitespace text nodes cannot appear as a child of <tr>

I’ve got this error:

Warning: validateDOMNesting(…): Whitespace text nodes cannot appear
as a child of . Make sure you don’t have any extra whitespace
between tags on each line of your source code.

in this condition

      <tr>
            {   
                data.length > 0 && 
                (
                    <>
                        <th>Files</th>
                        <td>
                            <ul>
                            {data}
                            </ul>
                        </td>
                    </>
                )
            }
        </tr>

And I really don’t know how to solve it. I also tried to remove the round brackets but it’s not working as well

94 thoughts on “React table Whitespace text nodes cannot appear as a child of <tr>”

Leave a Comment