Calling `ReactDOMServer.renderToStaticMarkup(elementWithPortal);` gets stuck in a loop while trying to do a static render.

Current behavior:
The behavior can be seen here: https://codepen.io/anon/pen/BmqWOM  by un-commenting line 58 (warning: this will make your tab freeze)

Expected behavior:
It should return with results or throw some kind of error if the input is not valid

}
        this.stack.push(frame);
        return '';
      } else {
        
        var nextElement = ((nextChild: any): ReactElement);
        return this.renderDOM(nextElement, context, parentNamespace);
      }
    }
  }
  renderDOM(
    element: ReactElement,
    context: Object,
    parentNamespace: string,
  ): string {
    var tag = element.type.toLowerCase();
    let namespace = parentNamespace;
    if (parentNamespace === Namespaces.html) {
      namespace = getIntrinsicNamespace(tag);
    }
    if (__DEV__) {
      if (namespace === Namespaces.html) {
        
        
        warning(
          tag === element.type,
          '<%s /> is using uppercase HTML. Always use lowercase HTML tags ' +
            'in React.',
          element.type,
        );