The code

``` javascript
class Comp extends React.Component {
  componentWillMount() {
    setTimeout(() => {
      this.setState({});
    });
  }

  render() {
    return <div onClick={() => {}} />;
  }
}

ReactDOMServer.renderToString(<Comp />);
```

produces errors:

> Warning: React can't find the root component node for data-reactid value `.0`. If you're seeing this message, it probably means that you've loaded two copies of React on the page. At this time, only a single copy of React can be loaded at a time.
> 
> Uncaught TypeError: Cannot read property 'firstChild' of undefined

But if I remove `onClick` handler the errors go away...

See demo: http://codepen.io/dened/pen/YyByYr

'Stateless function components cannot be given refs ' +
        '(See ref "%s" in %s created by %s). ' +
        'Attempts to access this ref will fail.',
        ref,
        componentName,
        this.getName()
      );
    }
    var refs = inst.refs === emptyObject ? (inst.refs = {}) : inst.refs;
    refs[ref] = publicComponentInstance;
  },
  /**
   * Detaches a reference name.
   *
   * @param {string} ref Name to dereference.
   * @final
   * @private
   */
  detachRef: function(ref) {
    var refs = this.getPublicInstance().refs;
    delete refs[ref];
  },
  /**
   * Get a text description of the component that can be used to identify it
   * in error messages.
   * @return {string} The name or null.
   * @internal
   */
  getName: function() {
    var type = this._currentElement.type;