Reactjs 每次单击按钮并调用其他.js组件时,我都会收到这些警告
每次单击按钮并调用其他.js组件时,我都会收到这些警告。我需要知道需要做些什么来消除这些警告Reactjs 每次单击按钮并调用其他.js组件时,我都会收到这些警告,reactjs,warnings,Reactjs,Warnings,每次单击按钮并调用其他.js组件时,我都会收到这些警告。我需要知道需要做些什么来消除这些警告 index.js:1 Warning: validateDOMNesting(...): <th> cannot appear as a child of <div>. in th (at Welcome.js:19) in Welcome (at Main.js:145) in StepForm (at App.js:8) in div (at
index.js:1 Warning: validateDOMNesting(...): <th> cannot appear as a child of <div>.
in th (at Welcome.js:19)
in Welcome (at Main.js:145)
in StepForm (at App.js:8)
in div (at App.js:7)
in div (at App.js:6)
in App (at src/index.js:9)
in StrictMode (at src/index.js:8)
index.js:1警告:validateDOMNesting(…):不能显示为的子级。
在th(在Welcome.js:19)
欢迎光临(Main.js:145)
以阶梯形式(见App.js:8)
在div中(在App.js:7中)
在div中(在App.js:6中)
应用程序内(位于src/index.js:9)
在StrictMode中(在src/index.js:8处)
允许的父项:一个
元素
这意味着在JSX中,
需要是
元素的直接子元素
<tr>
<th>...</th>
</tr>
...
您是否可以添加html以及您的代码,我认为您试图将tr添加为div子项,这是无效的。