Open Newbie012 opened 3 years ago
How about Column<AdvertiserColumns & { sticky: "right" | "left" }>[]
solved this by updating the react-table-config.d.ts
file from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-table
declare module 'react-table' {
export type UseStickyOptions = Partial<{
sticky: 'left' | 'right';
}>;
...
export interface ColumnInterface<
D extends Record<string, unknown> = Record<string, unknown>
> extends UseFiltersColumnOptions<D>,
UseGlobalFiltersColumnOptions<D>,
UseGroupByColumnOptions<D>,
UseResizeColumnsColumnOptions<D>,
UseSortByColumnOptions<D>,
UseStickyOptions {} // add this line
...
}
I have a basic
Table
component:And this is how I call the component:
The thing is, when I try to statically declare the
columns
, I get the following error:Which is correct, because in the end it points to this interface:
I know I can simply remove the typing
Column<AdvertiserColumns>[]
, but then it might lead to some bugs (e.g writeheader
instead ofHeader
). Any ideas?