title: REACT ERROR <th> cannot appear as a child of <thead>. See (unknown) > thead > th
body: <p>I am working on a react - rails app and I keep getting this error in my console: </p>
  
  <pre><code>```
  Warning: validateDOMNesting(...): &lt;th&gt; cannot appear as a child of &lt;thead&gt;. 
  See (unknown) &gt; thead &gt; th.
  </code></pre>
  
  <p>I'm not sure why this isn't working..I want to use header (thead) for a table and it worked for someone else. I would put tbody but I need that for the actual body of the table.</p>
  
  <p>here is my code for this table: </p>
  
  <pre><code>```  
       React.DOM.table
          className: 'table table-bordered'
          React.DOM.thead null,
            React.DOM.th null, 'Description'
            React.DOM.th null, 'Actions'
          React.DOM.tbody null,
            for post in @state.posts
              React.createElement Post, key: post.id, post: post, 
              handleDeletePost: @deletePost
  </code></pre>
  
  <p>**EDIT
  I have tried adding the tr tag under thead and that causes an extra added error. this is what I changed my code to:</p>
  
  <pre><code>```
     React.DOM.table
        className: 'table table-bordered'
        React.DOM.thead null
          React.DOM.tr null
            React.DOM.th null, 'Description'
            React.DOM.th null, 'Actions'
          React.DOM.tbody null,
            for post in @state.posts
              React.createElement Post, key: post.id, post: post, 
              handleDeletePost: @deletePost
  </code></pre>
  
  <p>and the next error i get is: Warning: validateDOMNesting(...): tr cannot appear as a child of table. See (unknown) > table > tr. Add a  to your code to match the DOM tree generated by the browser.</p>
  
  <p>I'm new to react and not familiar with coffeescript so I'm wondering if it has to do with the spacing or something. Tested out different spacing and that didn't help. I took out the thead all together and that caused my app to break so..not sure what's the problem</p>