<!--
  Please provide a clear and concise description of what the bug is. Include
  screenshots if needed. Please test using the latest version of the relevant
  React packages to make sure your issue has not already been fixed.
-->

React version: v16

## Steps To Reproduce

```js
import React from "react";

export const Q = React.memo(() => {});
export const Z = React.forwardRef(() => {});

export default function App() {
  return (
    <>
      <Q />
      <Z />
    </>
  );
}
```

Link to code example: https://codesandbox.io/s/hoc-throw-null-xrhwg

## The current behavior

No errors.

## The expected behavior

> Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.
refs = inst.refs = {};
        }
        if (value === null) {
          delete refs[stringRef];
        } else {
          refs[stringRef] = value;
        }
      };
      ref._stringRef = stringRef;
      return ref;
    } else {
      invariant(
        typeof mixedRef === 'string',
        'Expected ref to be a function, a string, an object returned by React.createRef(), or null.',
      );
      invariant(
        element._owner,
        'Element ref was specified as a string (%s) but no owner was set. This could happen for one of' +
          ' the following reasons:\n' +
          '1. You may be adding a ref to a function component\n' +
          "2. You may be adding a ref to a component that was not created inside a component's render method\n" +
          '3. You have multiple copies of React loaded\n' +
          'See https://fb.me/react-refs-must-have-owner for more information.',
        mixedRef,
      );
    }
  }
  return mixedRef;
}
function throwOnInvalidObjectType(returnFiber: Fiber, newChild: Object) {