[在React-table V6中,我们有一个道具-onExpandedChange,我们可以传递一个在更改扩展后将执行的函数,如何在react-table V7中实现相同功能
sinha,我没有发现任何方法来检测扩展更改,但是您可以使用扩展对象,因为它提供了扩展行的状态
const {
state: { expanded }, // this will give you row/nested-row id with status
} = useTable(
{
columns: userColumns,
data,
},
useExpanded // Use the useExpanded plugin hook
)