|
this.setState({ error: false }); |
It looks like this.redirect can sometimes call this.setState, and this.redirect is currently being called from render(). This can lead to bad situations, because this.setState will trigger another render() - so you can wind up creating an infinite loop where render calls setstate, which calls render, which calls setstate, ...
If possible, it'd be best to move the setState() somewhere else so that it doesn't happen at render time.