Explain why shouldComponentUpdate works

In reference to React: Optimize Re-Renders with shouldComponentUpdate

For “fun” I changed

     if (nextProps.value % 2 == 0) {
        return true;


      if (this.props.value % 2 == 0) {
        return true;

and sure enough everything is off by one. It returns odd numbers. But I don’t see why.

When the button is clicked isn’t addValue executed right away? Therefore when OnlyEvens runs isn’t this.props.value is already the next value?