svelte-headless-table
svelte-headless-table copied to clipboard
Fix type issue with creation of LabelHeader
Missing generic declaration in HeaderCell type creates typescript error when doing the following:
export function createDataTableHeaderCell<Item>(): HeaderLabel<Item, TablePlugins<Item>> {
return (cell: HeaderCell<Item, TablePlugins<Item>>) =>
createRender(MyHeaderCellComponent<Item>, {
props: cell.props(),
});
}
==>
Type '(cell: HeaderCell<Item, TablePlugins<Item>>) => ComponentRenderConfig<DataTableHeaderCell<Item>>' is not assignable to type 'HeaderLabel<Item, TablePlugins<Item>>'.