Autodesk / Autodesk/react-base-table
Making react-base-table work with array data
- Dominant language
- TypeScript
- Stars
- 1.5k
- Forks
- 170
- PR merge metrics
- No merged PRs in 30d
Description
Thank you for making this wonderful library. I've added it to my JavaScript grid library comparison page, https://jsgrids.statico.io/, and used it on a new tool I'm building to work with CSV files, which you can see in action here: https://csvhacker.statico.io/#url:%27https://csv.statico.io/10k.csv%27
For performance purposes, I want my data to be arrays of arrays, so I needed to tweak react-base-table so that it would assign React `key` properties correctly and not complain about violating prop types. Those hacks are here: https://github.com/statico/csvhacker/commit/4322b94d45497e86e3d66a7ead9b694979342275
```import TableRow from "react-base-table/es/TableRow"
TableRow.propTypes.rowData = PropTypes.array
import TableCell from "react-base-table/es/TableCell"
TableCell.propTypes.rowData = PropTypes.array
import GridTable from "react-base-table/es/GridTable"
GridTable.prototype._itemKey = ({ rowIndex }) => String(rowIndex)
```
It would be wonderful if react-base-table supported array data more easily, but I would understand if such functionality is out of scope.
Thanks!
Contributor guide
Assessment
This issue has not been assessed yet.