【发布时间】:2021-09-13 20:13:53
【问题描述】:
您好,我正在尝试使用此示例实现反应表过滤功能。https://react-table.tanstack.com/docs/examples/filtering。但我有一个问题。我创建了一个不同的组件,并在其中调用了我的 react-table 组件。我的意思是我的主要组件是包装表组件。有没有办法在 react-table 组件中获取 state.filters 数组?你能帮我解决这个问题吗?
我的主要组件:
....
import React from 'react'
import DataTable from '../dataTable/Datagrid'; --> imported react-table example different file as component
function List() {
// state management
// I want to call state.filters here to use set for any state
return (
<div>
<DataTable
columns={columns}
data={ playerState.items}
</>
</div>
)
}
export default List
...
【问题讨论】:
标签: reactjs react-hooks react-table-v7