3

I would like to be able to return 2 <tr> lines, which works by wrapping in a <tbody> as suggested here:

var Item = React.createClass({
    render: function() {
        return (
            <tbody>
                <tr>/*...*/</tr>
                <tr>/*...*/</tr>
            </tbody>
        );  
    }   
});

However, I get a warning from React: < tbody> cannot appear as a child of < tbody>

Is there any other way to do this that would be more DOM friendly?

Community
  • 1
  • 1
Ryan McClure
  • 1,183
  • 2
  • 17
  • 34
  • @AkshatMahajan: Likely just a typo in the post, otherwise the code would not even be parsed (because syntax error). – Felix Kling Apr 01 '16 at 23:35
  • Sorry, yes that was a typo in the post. – Ryan McClure Apr 01 '16 at 23:39
  • Have you tried appending it to instead of ? I've written a lot of HTML tables in the past & have never been forced by any browser to use these 3 tags: , or . They're optional &
    and tags work for separating header vs. body cells, respectively. Besides, most people have gotten away from tags & switched to
    tags, as
    tags cause conflicts with CSS. Only tabular data still needs
    tags.
    – Clomp Apr 01 '16 at 23:49
  • @Clomp https://facebook.github.io/react/docs/thinking-in-react.html – zerkms Apr 01 '16 at 23:50
  • Yes, that's tabular data, since it fits inside of a spreadsheet like grid. – Clomp Apr 01 '16 at 23:52