0

我正在使用 mui-datatables 加载超过 2000 行数据,在页面加载时仅加载其中的 15 个。当他们单击其中一行时,将获取更多数据以显示在展开表行中。

我有问题:

1. onRowClick 功能似乎不起作用

onRowClick我在我的处理程序中使用了他们的内置函数,但是这个函数一直被忽略,使用onRowClickwith renderExpandableRow,我的嵌套行不会扩展,只有这个函数onRowsExpand可以让我每个id加载评论,

2. 当我点击某一行时,我不断收到错误,控制台将显示:

Warning: Using UNSAFE_componentWillMount in strict mode is not recommended and may indicate bugs in your code. See react-unsafe-component-lifecycle for details.*

或这个:

Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method.

我从其他人的 github 上检查了问题,尝试了几种方法,希望能消除警告但不成功。

我尝试了所有这些我找到了resources1resources2 资源3

我使用的版本:

Material-UI: 3.4 mui-datatables": 2.12.4,

这是我在codeSandbox中创建的示例代码,感谢您阅读此问题并提供帮助!

4

0 回答 0