github jbetancur/react-data-table-component v7.0.0

latest releases: v7.6.2, v7.6.1, v7.6.0...
2 years ago

After several long months Version 7.0.0 is now available. The most notable change is that RDT 7 has been ported over to TypeScript which as it turns out resolved a number of bugs both unknown and long standing. This however, introduced some breaking changes to the API which are noted below. Also RDT v7 introduces several new features such as draggable columns, single row selection and the ability to pass props to expander components as well as vastly improved documentation.

Thank you all for your patience and to those that contributed PR's and/or feedback!

🔥 🔥 BREAKING CHANGES 🔥 🔥

  • expandableRowsComponent no longer accepts JSX and must now be passed in as a function/class. e.g.:
    GOOD:
    expandableRowsComponent={MyExpander}
    BAD:
    expandableRowsComponent={<MyExpander />}
  • sortFunction prop signature has changed, This was necessary because RDT is moving to function only selectors which are more flexible and performant. Additionally, this allows the API user greater control over how they sort. See the README for details Custom Sort Function.
  • defaultSortfField is now defaultSortFieldId where you use a column ID instead of a name.
    If you do not assign an id to each of your column definitions RDT will add a number based id starting with 1,2,3,...
  • overflowY and overflowYOffset have been removed from the API as they were problematic when using fixedHeader. These were originally created to deal menu overlays that did not use dynamic positioning - causing a menu to be truncated at the bottom of the table. Most UI libraries should support dynamically positioned menus, but in any case this is no longer the responsibility of RDT to manage.
  • TypeScript targets have been upgraded to es6 from es5. This might cause issues with older browsers "possibly" IE 11. RDT has not supported IE11 in the past and will not in the future.

🥃 🥃 New Features 🥃 🥃

  • Draggable column reordering is now available! See the Columns section in the Docs for details.
  • Single row selection feature is now available via a new prop selectableRowsSingle . If you want to change the built in checkbox to a radio button you can pass selectableRowsComponentProps={{ type: 'radio' }} or pass in your own custom/ui library Radio button using both selectableRowsComponent and selectableRowsComponentProps
  • Added a new prop: expandableRowsComponentProps now allows you to pass extra props to your custom expandableRowsComponent.

🐞 🐞 Fixes 🐞 🐞

  • fixedHeader scroll bar no longer offsets table columns. Note that fixedHeader relies on browsers that support sticky positioning.
  • Cleanup of stale sorting logic and CSS styles
  • TableHeadRow is no longer disabled when in a loading state. Instead, each TableCol is disabled from sorting
  • fixes a potential performance issue with large data sets and conditionalCells and conditionalRows
  • sortServer should now disable internal sorting as it did in v6
  • column centering show now work for both cells and cols
  • update peerDependencies for React 17
  • when using fixedHeader only show scroll bars when needed
  • fixes pagination select dropdown icon which was overlapping on larger numbers (e.g. 100, 1000 etc)
  • fixes double horizontal bar in some browsers. Thanks @HoangNguyen17193
  • you can now override fontWeight when using custom styles in headCells
  • fixes broken data table document not defined when using nextjs and pagination
  • if the columns prop is changed it should now re-render DataTable.
  • fixed an issue where using pre selected rows, unchecking a row and then and sorting would reset pre selects, this should no longer happen
  • There was a bug when using sortFunction and pagination together would result in broken sorting. This is now fixed.

📜📜 Documentation 📜📜

  • Documentation has been vastly improved. If you have ideas for additions or fixes please submit a PR!
  • The original plan was to do a custom documentation site, however, given some time constraints it was decided stick with storybook and implement some of it's newer features.

👋 👋 Deprecations 👋 👋

  • string selectors will display a console warning on non prod builds recommended you migrate to function selectors. This change is rather painless: selector: 'name' becomes selector: row => row.name. This not only allows for typing but also no longer requires an expensive regex/reduce function to loop through a row to "get' the prop

Don't miss a new react-data-table-component release

NewReleases is sending notifications on new releases.