if (typeof partialState === 'function') {
      super.setState((state, props) => {
        this._inAsyncStateUpdate = true;
        let ret;
        try {
          ret = partialState(state, props);
        } catch (err) {
          throw err;
        } finally {
          this._inAsyncStateUpdate = false;
        }
        return ret;
      }, callback);
    }
`setState` is called asynchronously, and should not rely on the value of
`this.props` or `this.state`:
https://reactjs.org/docs/state-and-lifecycle.html#state-updates-may-be-asynchronous

SafePureComponent adds runtime enforcement, to catch cases where these
variables are read in a state updater function, instead of the ones passed
in.