See this example: https://github.com/facebook/react/issues/11508#issuecomment-345464797.

I think it probably reflects a misunderstanding of how props and state work, and we should detect and warn if we see this.
state = {};
      getSnapshotBeforeUpdate() {
        return null;
      }
      componentWillMount() {
        throw Error('unexpected');
      }
      componentWillReceiveProps() {
        throw Error('unexpected');
      }
      componentWillUpdate() {
        throw Error('unexpected');
      }
      componentDidUpdate() {}
      render() {
        return null;
      }
    }
    const container = document.createElement('div');
    expect(() => ReactDOM.render(<Component value={1} />, container)).toWarnDev(
      'Unsafe legacy lifecycles will not be called for components using new component APIs.',
      {withoutStack: true},
    );
    ReactDOM.render(<Component value={2} />, container);
  });
  it('should not invoke new unsafe lifecycles (cWM/cWRP/cWU) if static gDSFP is present', () => {
    class Component extends React.Component {