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.
this._didScheduleRenderPhaseUpdate = false;
      this._numberOfReRenders += 1;
      
      this._workInProgressHook = null;
      this._rendering = false;
      this.render(element, context);
    } else {
      this._currentlyRenderingComponent = null;
      this._workInProgressHook = null;
      this._renderPhaseUpdates = null;
      this._numberOfReRenders = 0;
    }
  }
  getMountedInstance() {
    return this._instance;
  }
  getRenderOutput() {
    return this._rendered;
  }
  render(element: ReactElement | null, context: null | Object = emptyObject) {
    invariant(
      React.isValidElement(element),
      'ReactShallowRenderer render(): Invalid component element.%s',
      typeof element === 'function'
        ? ' Instead of passing a component class, make sure to instantiate ' +
          'it by passing it to React.createElement.'
        : '',
    );