svelte-headless-table icon indicating copy to clipboard operation
svelte-headless-table copied to clipboard

Fix type issue with creation of LabelHeader

Open nbarraille opened this issue 4 months ago • 1 comments

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>>'.

nbarraille avatar Sep 30 '24 16:09 nbarraille