Skip to content

Commit

Permalink
fix: create table column constraints
Browse files Browse the repository at this point in the history
  • Loading branch information
tannerlinsley committed Apr 3, 2022
1 parent c0d0dd5 commit 1fb1c63
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions packages/table-core/src/createTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,12 @@ export type Table<TGenerics extends PartialGenerics> = {
) => ColumnDef<TGenerics>
createDisplayColumn: (
column: PartialKeys<
_NonGenerated<ColumnDef<TGenerics>>,
Overwrite<
_NonGenerated<ColumnDef<TGenerics>>, {
// This is sketchy, but allows the column helper pattern we want.
// Someone smarter than me could probably do this better.
columns?: ColumnDef<any>[]
}>,
'accessorFn' | 'accessorKey'
>
) => ColumnDef<TGenerics>
Expand Down Expand Up @@ -93,7 +98,10 @@ export type Table<TGenerics extends PartialGenerics> = {
: never,
{
accessorFn?: never
accessorKey?: never
accessorKey?: never,
// This is sketchy, but allows the column helper pattern we want.
// Someone smarter than me could probably do this better.
columns?: ColumnDef<any>[]
}
>
) => ColumnDef<
Expand Down

1 comment on commit 1fb1c63

@incognos
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still generating a ton of typescript errors for the createDataColumn

Type 'Cell<Overwrite<Overwrite<Partial<DefaultGenerics>, { Render: <TProps extends {}>(Comp: Renderable<TProps>, props: TProps) => ReactNode; }>, { ...; }>>' is not assignable to type 'Cell<Overwrite<Overwrite<Overwrite<Partial<DefaultGenerics>, { Render: <TProps extends {}>(Comp: Renderable<TProps>, props: TProps) => ReactNode; }>, { ...; }>, { ...; }>>'.ts(2322)

Please sign in to comment.