Version: 7.0.0-alpha.22
Describe the bug
when using flatColumns to access the length of the columns (using this in conjunction with useExpanded), I get undefined.
To Reproduce
Steps to reproduce the behavior:
Given the following example:
const {
flatColumns,
getTableProps,
headerGroups,
} = useTable(
{
columns,
data,
},
useExpanded,
);
Getting flatColumns undefined error. Using columns property instead.
Expected behavior
Expected to have flatColumns property.
Desktop (please complete the following information):
Try to use latest i.e. beta version
Will try it out, thanks ;)
flatColumns is new to the latest versions. You should be fine after updating
I'm seeing this issue again using 7.0.0-rc.16
Has there been a regression or change @tannerlinsley ?
It looks like according to https://github.com/tannerlinsley/react-table/blob/facb216f5ca7ed5cf2d438df1c319eac27fd70d3/CHANGELOG.md#700-rc16 that flatColumns has been renamed to allColumns
Changing my hook to reflect that seems to have resolved the issue.
@tannerlinsley it's probably worth updating examples?
e.g. https://github.com/tannerlinsley/react-table/blob/facb216f5ca7ed5cf2d438df1c319eac27fd70d3/examples/kitchen-sink/src/App.js#L320 seems to suggest we should use visibleColumns ... are there docs to reflect how each property is used?
A little further investigation I found this: https://github.com/tannerlinsley/react-table/blob/master/docs/api/useTable.md#instance-properties
It's still unclear which property one should use and why... e.g. if I want to add a column through a hook it seems I can use allColumns, columns, and visibleColumns based on experimentation...
This is more just a lack of docs around plugins. I’ll start making those when I find time.
On Feb 22, 2020, 8:48 AM -0700, Hunter Barrington notifications@github.com, wrote:
A little further investigation I found this: https://github.com/tannerlinsley/react-table/blob/master/docs/api/useTable.md#instance-properties
It's still unclear which property one should use and why... e.g. if I want to add a column through a hook it seems I can use allColumns, columns, and visibleColumns based on experimentation...
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
Most helpful comment
This is more just a lack of docs around plugins. I’ll start making those when I find time.
On Feb 22, 2020, 8:48 AM -0700, Hunter Barrington notifications@github.com, wrote: