Skip to content

5.18.0

Compare
Choose a tag to compare
@simonguo simonguo released this 24 Nov 03:53
· 26 commits to main since this release

Features

The children prop of the Table supports function types. When using TypeScript, it is recommended to pass a render prop to the Table component. This ensures that the correct generic type parameter is automatically propagated to the Cell component.

const products: Product[] = [{ name: 'Pineapple' }];

<Table<Product, string> ref={table} data={products}>
  {({ Column, HeaderCell, Cell }) => (
    <>
      <Column>
        <HeaderCell>Name</HeaderCell>
        {/* No need for passing explicit type parameter to Cell */}
        <Cell>{row => row.name}</Cell>
      </Column>
    </>
  )}
</Table>;

What's Changed

New Contributors

Full Changelog: 5.17.0...5.18.0