2020-05-05
A few changes were made in order to support increased customization, with more to come in future releases.
- The
cellproperty in the columns array has been changed.cellnow renders the entire cell, as opposed to just the contents inside of the cell. This is now an advanced feature. cellnow expects a component that takes in thestyleprop as well.stylewill contain the correct widths of the cell.
{
key: 'id',
header: 'ID',
cell: ({ row, style }) => (
<div style={style}>
{row.id}
</div>
)
}- Added the
contentproperty. This property functions exactly howcellused to function in previous releases.contentrenders a custom component inside of the default cell.
{
key: 'id',
header: 'ID',
content: ({ row }) => row.id
}- For simplicity, added an
onRowClickproperty that takes an event and the index of the row that was clicked.
type onRowClick = (e: Event, { index }: { index: number }) => void;- Added a
rowRenderer, which also takes astyleprop. This is useful if you want to customize the wrapper around the cells in a row.
2020-04-26
- added the props
rowStyle,tableStyle, andheaderStyleto allow for more customization options. Since the Table component does take aclassName, you can still do things using libraries such asstyled-componentsif you prefer.
2020-04-19
- less
setStatecalls when updating the default size.
2020-04-19
estimatedRowHeightis no longer in use. For tables with no specifiedrowHeight, the median of the rendered row heights is used as a default if the row had not been rendered before.
- Uses memoization in more places.
- reduces row flicker issue when resizing.