For consideration.

These warnings are already covered by renderers based on react-reconciler. Maybe we don't gain that much by mirroring them in the shallow renderer? Maybe it's not worth the added complexity? Particularly with more complicated warnings like the ones being added for #12419 and #12404.
render() {
        return null;
      }
    }
    const shallowRenderer = createRenderer();
    expect(() => shallowRenderer.render(<ComponentWithWarnings />)).toWarnDev(
      'ComponentWithWarnings uses getDerivedStateFromProps() but also contains the following legacy lifecycles',
    );
    
    shallowRenderer.render(<ComponentWithWarnings />);
  });
  it('should warn if getDerivedStateFromProps returns undefined', () => {
    class Component extends React.Component {
      state = {};
      static getDerivedStateFromProps() {}
      render() {
        return null;
      }
    }
    const shallowRenderer = createRenderer();
    expect(() => shallowRenderer.render(<Component />)).toWarnDev(
      'Component.getDerivedStateFromProps(): A valid state object (or null) must ' +
        'be returned. You have returned undefined.',
    );
    
    shallowRenderer.render(<Component />);
  });
  it('should warn if state not initialized before getDerivedStateFromProps', () => {
    class Component extends React.Component {