[v8] Export TableHelper type #3770
-
The return type of type TableHelper = ReturnType<typeof createTable> However, it seems like exporting For background, this is what I want to use it for: export function createSelectCol(tableHelper: TableHelper) {
return tableHelper.createDisplayColumn({
id: 'select',
header: ({ instance }) => (
<Checkbox {...instance.getToggleAllRowsSelectedProps()} />
),
cell: ({ row }) => (
<div className="px-1">
<Checkbox {...row.getToggleSelectedProps()} />
</div>
),
})
} Edit: actually the
Here's another way to do it, which does actually work, though having to put all those export const selectColConfig = {
id: 'select',
header: ({ instance }: { instance: ReactTable<any, any, any, any, any> }) => (
<Checkbox {...instance.getToggleAllRowsSelectedProps()} />
),
cell: ({ row }: { row: Row<any, any, any, any, any> }) => (
<div className="px-1">
<Checkbox {...row.getToggleSelectedProps()} />
</div>
),
} |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Wanna open a PR? |
Beta Was this translation helpful? Give feedback.
Wanna open a PR?