1.1.0 • Published 5 years ago
efficient-react-table v1.1.0
efficient-react-table
A simple data table inspired by react-table. The package "react-table" does not do efficient rendering of rows and cells. This package "efficient-react-table" offers the following features:
- Simpler and Faster
- Rows and Cells with same data do not re-render
- Rows can be grouped into continuous pages
- Rows can by stlyed according to their data
- A configurable subset of rows are loaded initially. Useful when table data is very large
- Infinite scrolling
- Supports multi-sorting
Example:
let columns = [
{
Header: "Id",
accessor: "id",
sortable:true
},
{
Header: "Name",
accessor: "name",
Cell: cellInfo => <input value={cellInfo.value} />
},
{
Header: "Country",
accessor: "country"
},
{
Header: "Unit",
accessor: "unit",
show: false
}
];
let data = [
{ id:101, name:"Alice",country:"USA",unit:"FMCG" },
{ id:102, name:"Bob",country:"UK",unit:"Retail" },
{ id:103, name:"Charles",country:"India",unit:"Auto" },
{ id:104, name:"Dave",country:"UK",unit:"Retail" },
{ id:105, name:"Emily",country:"USA",unit:"BFSI" }
]
<EfficientReactTable
columnDefinitions={this.state.columns}
pageSize={4}
thresholdPageCount={3}
data={this.state.data}
rowStyler={row => {
if (row["id"] === 102) return { backgroundColor: "red" };
}}
/>
Extremely basic version, new features to follow