gregnb / gregnb/mui-datatables
Api data rendering break in table transform data
- Dominant language
- JavaScript
- Stars
- 2.7k
- Forks
- 906
- PR merge metrics
- No merged PRs in 30d
Description
TypeError: Cannot read property 'call' of undefined
a.transformData
src/MUIDataTable.js:682
679 |
680 | return columns.map(col => {
681 | if (!col.empty) i++;
> 682 | return col.empty ? undefined : row[i];
| ^ 683 | });
684 | })
685 | : data.map(row => columns.map(col => leaf(row, col.name)));
View compiled
a.value
src/MUIDataTable.js:714
711 | props.columns.forEach((column, colIndex) => {
712 | if (column.options && (column.options.sortDirection === 'asc' || column.options.sortDirection === 'desc')) {
713 | sortOrder.name = column.name;
> 714 | sortOrder.sortDirection = column.sortDirection;
| ^ 715 | }
716 | });
717 | }
View compiled
a.value
src/MUIDataTable.js:327
324 |
325 | componentDidUpdate(prevProps) {
326 | if (
> 327 | this.props.data !== prevProps.data ||
| ^ 328 | this.props.columns !== prevProps.columns ||
329 | this.props.options !== prevProps.options
330 | ) {
View compiled
## Expected Behavior
## Current Behavior
## Steps to Reproduce (for bugs)
1.
2.
3.
4.
## Your Environment
| Tech | Version |
|--------------|---------|
| Material-UI | |
| MUI-datatables | |
| React | |
| browser | |
| etc | |
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in src/MUIDataTable.js around transformData (line 682) and the sort-order handling near line 714. Reproduce the reported API-data table case first, since the issue provides no steps, versions, or example; done means the case renders without the reported TypeError and the relevant behavior is covered by a regression check.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100