This code causes a maximum call stack:
getChildContext() {
this.setState({
foo: 'bar',
});
return {
foo: this.state.foo,
};
}
These sort of errors are hard to track down as the stack trace is deep in react. Is this a place we can give a user an invariant to let them know what they did wrong?