<!--
  Note: if the issue is about documentation or the website, please file it at:
  https://github.com/reactjs/reactjs.org/issues/new
-->

**Do you want to request a *feature* or report a *bug*?**
Feature (to catch potential bugs)

**What is the current behavior?**
The react-hooks/rules-of-hooks ESLint rule catches uses of hooks in conditionals in components, but does not recognise an anonymous function wrapped in forwardRef as a component. 

The following example breaks the rules of hooks, but isn't caught by the rule:
```jsx
// This should fail
const FancyButton = React.forwardRef((props, ref) => {
  if (props.fancy) {
    useCustomHook();
  }
  return <button ref={ref}>{props.children}</button>;
});
```

**What is the expected behavior?**
The above example should be caught by react-hooks/rules-of-hooks, and raise the "React Hook "useCustomHook" is called conditionally" error.

`,
    `
      // Currently valid because we found this to be a common pattern
      // for feature flag checks in existing components.
      // We *could* make it invalid but that produces quite a few false positives.
      // Why does it make sense to ignore it? Firstly, because using
      // hooks in a class would cause a runtime error anyway.
      // But why don't we care about the same kind of false positive in a functional
      // component? Because even if it was a false positive, it would be confusing
      // anyway. So it might make sense to rename a feature flag check in that case.
      class ClassComponentWithFeatureFlag extends React.Component {
        render() {
          if (foo) {
            useFeatureFlag();
          }
        }
      }
    `,
    `
      // Currently valid because we don't check for hooks in classes.
      // See ClassComponentWithFeatureFlag for rationale.
      // We *could* make it invalid if we don't regress that false positive.
      class ClassComponentWithHook extends React.Component {
        render() {
          React.useState();
        }
      }
    `,
    `
      // Currently valid.