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

constructor() {
          super();
        }
        render() {
          return <div>{this.props.text}</div>;
        }
      }
      var markup = ReactDOMServer.renderToString(
        <Component text="hello, world" />,
      );
      expect(markup).toContain('hello, world');
    });
    it('renders with context when using custom constructor', () => {
      class Component extends React.Component {
        constructor() {
          super();
        }
        render() {
          return <div>{this.context.text}</div>;
        }
      }
      Component.contextTypes = {
        text: PropTypes.string.isRequired,
      };
      class ContextProvider extends React.Component {