-
Notifications
You must be signed in to change notification settings - Fork 430
Closed
Description
Good afternoon, I'm trying to sum column data, but I always get the same error. Someone has an idea how to do this.
I've tried something like:
const rowClasses = (row, rowIndex) => {
if (row.status !== "Cancelado" && row.pagrec === "Pagamento"){
var value = row.vlfinal;
this.setState({amount: this.state.amount += value});
return;
}
};
<BootstrapTable
noDataIndication="X"
striped keyField='id' data={data} columns={columns}
rowStyle={rowStyle}
rowClasses={rowClasses} />
I get the error:
index.js:2178 Warning: Cannot update during an existing state transition (such as within
renderor another component's constructor). Render methods should be a pure function of props and state; constructor side-effects are an anti-pattern, but can be moved to
componentWillMount.
Any suggestion would be helpful.
Metadata
Metadata
Assignees
Labels
No labels