Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/89.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 反应错误<;th>;不能显示为<;的子级;thead>;。请参阅(未知)>;thead>;th_Javascript_Jquery_Ruby On Rails_Reactjs - Fatal编程技术网

Javascript 反应错误<;th>;不能显示为<;的子级;thead>;。请参阅(未知)>;thead>;th

Javascript 反应错误<;th>;不能显示为<;的子级;thead>;。请参阅(未知)>;thead>;th,javascript,jquery,ruby-on-rails,reactjs,Javascript,Jquery,Ruby On Rails,Reactjs,我正在使用react-rails应用程序,我的控制台中不断出现以下错误: ``` Warning: validateDOMNesting(...): <th> cannot appear as a child of <thead>. See (unknown) > thead > th. **编辑 我尝试在AD下添加tr标记,这会导致额外的附加错误。我将代码更改为: ``` React.DOM.table className: 'tabl

我正在使用react-rails应用程序,我的控制台中不断出现以下错误:

```
Warning: validateDOMNesting(...): <th> cannot appear as a child of <thead>. 
See (unknown) > thead > th.
**编辑 我尝试在AD下添加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,这导致我的应用程序坏了。不确定问题出在哪里,而不是
th

<table>
  <thead>
    <tr>
      <th />
    </tr>
  </thead>
  ...
</table>

...

th
应嵌套在
tr
下,而不是
thead


名称
年龄
厕所
33
史密斯
22
简
24

由于列表中其他地方的错误,我出现了这个错误


例如@Sag1v使用
而不是
来关闭他的列表主体,我打赌这是导致错误的原因

错误地,我把
tbody
放在
thead

(一)


...
...
而不是(2)


...
...

改为(2)解决了我的问题。

应该是
thead>tr>th
我输入了
thread
而不是
thead
我尝试将tr添加到我的代码的thead下,但它给了我一个额外的错误。``React.DOM.table className:'table table bordered'React.DOM.thead null React.DOM.tr nullReact.DOM.th null,“Description”React.DOM.th null,“Actions”React.DOM.tbody null,对于@state.posts React.createElement post中的post,key:post.id,post:post,handleDeletePost:@deletePosti仍然有我的原始错误以及“tr不能作为表的子项出现”安迪从来没想到React会教我一些关于HTML的东西!
<table>
  <thead>
    <tr>
      <th />
    </tr>
  </thead>
  ...
</table>
<thead>
...
  <tbody>
  ...
  </tbody>
</thead>
<thead>
...
</thead>

<tbody>
...
</tbody>