每次单击按钮并调用其他 .js 组件时,我都会收到这些警告

I am getting these warnings everytime I click a button and call other .js components

每次单击按钮并调用其他 .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 App.js:7)
    in div (at App.js:6)
    in App (at src/index.js:9)
    in StrictMode (at src/index.js:8)

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/th

Permitted parents: A <tr> element

这意味着在您的 JSX 中,<th> 需要是 <tr> 元素的直接子元素。

<tr>
  <th>...</th>
</tr>