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

lifecycle.push('shouldComponentUpdate');
          }
          componentWillReceiveProps() {
            lifecycle.push('componentWillReceiveProps');
          }
          componentWillUnmount() {
            lifecycle.push('componentWillUnmount');
          }
        }
        var response = ReactDOMServer.renderToStaticMarkup(<TestComponent />);
        expect(response).toBe('<span>Component name: TestComponent</span>');
        expect(lifecycle).toEqual([
          'getInitialState',
          'componentWillMount',
          'render',
        ]);
      }
      runTest();
    });
    it('should throw with silly args', () => {
      expect(
        ReactDOMServer.renderToStaticMarkup.bind(ReactDOMServer, {x: 123}),
      ).toThrowError(
        'Objects are not valid as a React child (found: object with keys {x})',
      );
    });
    it('allows setState in componentWillMount without using DOM', () => {
      class Component extends React.Component {