【问题标题】:React-Table : Row select - Not able to select multiple rowsReact-Table:行选择 - 无法选择多行
【发布时间】:2020-11-01 14:22:35
【问题描述】:

我无法选择多行 - 如果我选择一行,已选择的行将被取消选择 - 也就是说我一次只能选择 1 行。

有时我可以一个接一个地选择 2 行,但是当我选择第 3 行时,已选择的行之一会自动取消选择,不允许我一个接一个地选择所有 3 行

虽然全选复选框工作正常,但选中时所有行都被选中。

我提供了由 3 行组成的数据

请帮忙。

代码沙盒 - https://codesandbox.io/s/upbeat-breeze-hyodx?file=/src/App.js

【问题讨论】:

    标签: reactjs react-table


    【解决方案1】:

    问题出在 index.js 文件中, React-Table 官方代码框 -

    ReactDOM.render(<App />, document.getElementById('root'))
    

    我使用 React.StrictMode 如下 -

    const rootElement = document.getElementById("root");
    ReactDOM.render(
      <React.StrictMode>
        <App />
      </React.StrictMode>,
      rootElement
    );
    

    在删除 React.StrictMode 时,一切正常,但不确定为什么 Strict Mode 会干扰

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-03-16
      • 2019-08-11
      • 2016-11-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-06-14
      • 1970-01-01
      相关资源
      最近更新 更多