<input>不能作为<tr>的子项出现

grp*_*cMe 6 html reactjs

我想<input>在我的表中添加一个元素,更具体地说是一个复选框.以下作品:

<tbody key={rule._id}>
  <tr>
    <td>{rule.deviceId}</td>
    {
      <input
        name="isEnabled"
        type="checkbox"
        checked={rule.enabled}
      />
    }
    <td>{rule.name}</td>
  </tr>
</tbody>
Run Code Online (Sandbox Code Playgroud)

但它在控制台中产生错误: <input> cannot appear as a child of <tr>

有没有'适当'的方法来做到这一点?

Que*_*tin 15

放在<input>里面<td>.