5.18.0
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