If you attach a `ref` to an element using a string (`ref='foo'`) and use `ReactTestRenderer` you get the `"Stateless function components cannot be given refs"` warning

See https://github.com/facebook/react/issues/7371#issuecomment-237816352

This is because `getPublicInstance` returns `null` and `attachRef` requires that the instance be non-null in the warning invariant.

I think we can either return a simple instance instead of `null` or use some additional check in `attachRef` to see if we're dealing with `ReactTestRenderer`. The first option seems reasonable, given the comment in the current code: 

``` js
ReactTestComponent.prototype.getPublicInstance = function() {
  // I can't say this makes a ton of sense but it seems better than throwing.
  // Maybe we'll revise later if someone has a good use case.
  return null;
};
```

cc @spicyj 

var ReactComponentEnvironment = require('ReactComponentEnvironment');
var ReactCurrentOwner = require('ReactCurrentOwner');
var ReactErrorUtils = require('ReactErrorUtils');
var ReactInstanceMap = require('ReactInstanceMap');
var ReactInstrumentation = require('ReactInstrumentation');
var ReactNodeTypes = require('ReactNodeTypes');
var ReactReconciler = require('ReactReconciler');
if (__DEV__) {
  var checkReactTypeSpec = require('checkReactTypeSpec');
}
var emptyObject = require('emptyObject');
var invariant = require('invariant');
var shallowEqual = require('shallowEqual');
var shouldUpdateReactComponent = require('shouldUpdateReactComponent');
var warning = require('warning');
import type { ReactPropTypeLocations } from 'ReactPropTypeLocations';
var CompositeTypes = {
  ImpureClass: 0,
  PureClass: 1,
  StatelessFunctional: 2,
};
function StatelessComponent(Component) {
}
StatelessComponent.prototype.render = function() {
  var Component = ReactInstanceMap.get(this)._currentElement.type;
  var element = Component(this.props, this.context, this.updater);
  warnIfInvalidElement(Component, element);
  return element;
};
function warnIfInvalidElement(Component, element) {