I am new to react and react tabulator. I am getting an error which I am not understanding.
This is my react tabulator code:
render() {
const options = {
pagination: 'local',
paginationSize: 5,
layout: 'fitDataFill',
};
const ReportColumns = [
{
title: 'TDC',
field: 'TDC',
minWidth: 20,
headerSort: false,
headerFilter: 'input',
headerFilterPlaceholder: 'search...',
},
];
<ReactTabulator
data={this.state.reportList}
columns={ReportColumns}
options={options}
// rowClick={this.rowClick}
id="reportGrid"
/>
I am getting reportList from this function: I am getting value in reportList from the backend and adding it in reportList in the form of an array and populating it
getTableValue = () => {
this.setState({ dataLoading: true });
axiosAPI.post('api/observation/GetTableValue').then(response => {
var rows = [];
console.log('values for response:' + JSON.stringify(response.data));
for (var i in response.data) {
var rowdata = response.data[i];
var ID = ++i;
rows.push({
ID: ID,
OrgUnit: rowdata.OrgUnit,
TDC: rowdata.TDC,
CustCode: rowdata.CustCode,
CustName: rowdata.CustName,
DestCode: rowdata.DestCode,
EMV: rowdata.EMV,
Service: rowdata.Service,
SPCCode: rowdata.SPCCode,
SPCode: rowdata.SPCode,
Remarks: rowdata.Remarks,
Stage: rowdata.Stage,
Cost: rowdata.Cost,
SAPUpdate: rowdata.SAPUpdate,
Active: rowdata.Active,
CreatedBy: rowdata.CreatedBy,
CreatedOn: rowdata.CreatedOn,
UpdatedBy: rowdata.UpdatedBy,
UpdatedOn: rowdata.UpdatedOn,
});
//this.setState({ reportList: rows });
}
this.setState({ reportList: rows });
this.setState({ dataLoading: false });
});
};
I am inititializing reportList as an array in the state as so:
reportList: [],
This is the error I am getting:
./node_modules/tabulator-tables/dist/js/tabulator_esm.js 6792:93
Module parse failed: Unexpected token (6792:93)
You may need an appropriate loader to handle this file type.
| function progress(cell, onRendered, success, cancel, editorParams) {
| var element = cell.getElement(),
> max = typeof editorParams.max === "undefined" ? element.getElementsByTagName("div")
[0]?.getAttribute("max") || 100 : editorParams.max,
| min = typeof editorParams.min === "undefined" ? element.getElementsByTagName("div")
[0]?.getAttribute("min") || 0 : editorParams.min,
| percent = (max - min) / 100,
I am not understanding what the error is and hence not able to resolve. Please help me in understanding the error and resolving it. Please help

