Demonstrated at http://jsfiddle.net/xnhzvdoa/1/; open the error console and you should see this:
Uncaught Error: Invariant Violation: addComponentAsRefTo(...): Only a ReactOwner can have refs. This usually means that you're trying to add a ref to a component that doesn't have an owner (that is, was not created inside of another component's `render` method). Try rendering this component inside of a new top-level component which will hold the ref.
var Bug = React.createClass({
render: function() {
var html = React.renderToStaticMarkup(React.DOM.img());
return React.DOM.div({ ref: 'ref' }, html);
}
});
Bug = React.createFactory(Bug);
React.render(Bug(), document.body);