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

render() {
          return <div>inner text</div>;
        }
      }
      class TestComponent extends React.Component {
        render() {
          return (
            <span>
              <NestedComponent />
            </span>
          );
        }
      }
      var response = ReactDOMServer.renderToStaticMarkup(<TestComponent />);
      expect(response).toBe('<span><div>inner text</div></span>');
    });
    it('should not put checksum and React ID on text components', () => {
      class TestComponent extends React.Component {