I have received
ERROR: "Uncaught RangeError: Maximum call stack size exceeded"
I suspect that this block of code in my componentWillUpdate method is the cause, since I've only been receiving the errors right after I added the code. Is there anything that I've done wrong here?
componentWillUpdate(nextProps, nextState) {
...
if (nextProps.show) {
for (var i = 0; i < this.props.data.actions.length; i++) {
if (this.props.data.actions[i].assignedTo !== this.state.userId && this.state.showActions === true) {
this.setState({ showActions: false })
}
if (this.props.data.actions[i].assignedTo === this.state.userId && this.state.showActions === false) {
this.setState({ showActions: true })
}
}
}
...
}
nextProps.show is set to true when a button is clicked, then it checks whether the person assigned an action is the same as the user that is logged in, then it will set the state showActions to true. This state is used to display/hide rows if the conditions in the code are met