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.
return <div />;
      }
    }
    const shallowRenderer = createRenderer();
    shallowRenderer.render(<SomeComponent foo={1} />);
    
    
    expect(logs).toEqual(['componentWillMount']);
    logs.splice(0);
    const instance = shallowRenderer.getMountedInstance();
    instance.setState({});
    expect(logs).toEqual(['shouldComponentUpdate', 'componentWillUpdate']);
    logs.splice(0);
    shallowRenderer.render(<SomeComponent foo={2} />);
    
    expect(logs).toEqual([
      'componentWillReceiveProps',
      'shouldComponentUpdate',
      'componentWillUpdate',
    ]);
  });
  it('should call all of the new lifecycle hooks', () => {
    const logs = [];
    const logger = message => () => logs.push(message) || true;
    class SomeComponent extends React.Component {