In https://reactjs.org/tutorial/tutorial.html#lifting-state-up
It mentions changing the Square component to
class Square extends React.Component { render() { return ( <button className="square" onClick={() => this.props.onClick()} > {this.props.value} </button> ); } }
But this results in the page error:
Error: Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.
To fix this, I had to change the onClick to:
onClick={() => this.props.onClick}