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.
render() {
        return <span />;
      }
    }
    const shallowRenderer = createRenderer();
    shallowRenderer.render(<SomeComponent />);
    expect(shallowRenderer.getMountedInstance().state).toBeNull();
  });
  it('should invoke both deprecated and new lifecycles if both are present', () => {
    const log = [];
    class Component extends React.Component {
      componentWillMount() {
        log.push('componentWillMount');
      }
      componentWillReceiveProps() {
        log.push('componentWillReceiveProps');
      }
      componentWillUpdate() {
        log.push('componentWillUpdate');
      }
      UNSAFE_componentWillMount() {
        log.push('UNSAFE_componentWillMount');
      }
      UNSAFE_componentWillReceiveProps() {
        log.push('UNSAFE_componentWillReceiveProps');
      }
      UNSAFE_componentWillUpdate() {