TS issue with createColumns
in v8
#3803
-
Given this code from the examples (removed some parts for readability): const table = createTable<{ Row: Person }>()
const defaultColumns = table.createColumns([
table.createGroup({
header: 'Name',
footer: props => props.column.id,
columns: [
table.createDataColumn('firstName', {
cell: info => info.value,
footer: props => props.column.id,
}),
table.createDataColumn(row => row.lastName, {
id: 'lastName',
cell: info => info.value,
header: () => <span>Last Name</span>,
footer: props => props.column.id,
}),
],
}),
]) I wanted to use this without column groups, however if I try to flatten this out like so: ```tsx
const table = createTable<{ Row: Person }>()
const defaultColumns = table.createColumns([
table.createDataColumn('firstName', {
cell: info => info.value,
footer: props => props.column.id,
}),
table.createDataColumn(row => row.lastName, {
id: 'lastName',
cell: info => info.value,
header: () => <span>Last Name</span>,
footer: props => props.column.id,
}),
]) If I do this I get a massive type error referencing a few different things, but particularly noticeable:
I am a bit confused as to why this is happening. Luckily from a functional perspective nothings really wrong here, so I haven't been blocked, but it'd be nice to get this working instead of relying on the Also lmk if this should be a github issue, didn't want to jump the gun and crowd up the list of issues if it's something known / being worked on rn. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Are you on the latest version? |
Beta Was this translation helpful? Give feedback.
Are you on the latest version?