See the issue and the test case with original fix in https://github.com/facebook/react/pull/14802.

We'll need to fix it properly, see https://github.com/facebook/react/pull/14802#issuecomment-463277621.
state = {};
      render() {
        instance = this;
        return null;
      }
    }
    const shallowRenderer = createRenderer();
    shallowRenderer.render(<SimpleComponent />);
    instance.setState(function updater(state, props) {
      expect(this).toBe(instance);
      done();
    });
  });
  it('can setState with a callback', () => {
    let instance;
    class SimpleComponent extends React.Component {