我對工作做出反應 - Rails應用程序,我不斷收到此錯誤在我的控制檯:REACT ERROR <th>不能作爲<thead>的子代出現。見(未知)> THEAD>日
```
Warning: validateDOMNesting(...): <th> cannot appear as a child of <thead>.
See (unknown) > thead > th.
我不知道這是爲什麼不working..I想要使用header(thead)作爲表格,並且適用於其他人。我會把tbody,但我需要爲表的實際主體。
這裏是我此表代碼:
```
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
**編輯 我曾嘗試加入下THEAD tr標籤,並導致額外的附加誤差。這是我改變了我的代碼:
```
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
和下一個錯誤我得到的是:警告:validateDOMNesting(...):TR不能作爲表的子表。參見(未知)> table> tr。添加一個代碼以匹配瀏覽器生成的DOM樹。
我是新來的反應和不熟悉咖啡的腳本,所以我想知道它是否與間距或什麼有關。測試了不同的間距,並沒有幫助。我拿出了所有的一起,這導致我的應用程序打破所以..不知道有什麼問題
它應該是'thead> tr> th' – zerkms