<!--
  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.

paths += countPathsFromStart(prevSegment);
            }
          }
          
          
          if (segment.reachable && paths === 0) {
            cache.delete(segment.id);
          } else {
            cache.set(segment.id, paths);
          }
          return paths;
        }
        /**
         * Count the number of code paths from this segment to the end of the
         * function. For example:
         *
         * ```js
         * function MyComponent() {
         *    Segment 1
         *   if (condition) {
         *      Segment 2
         *   } else {
         *      Segment 3
         *   }
         * }
         * ```
         *
         * Segments 2 and 3 have one path to the end of `MyComponent` and
         * segment 1 has two paths to the end of `MyComponent` since we could
         * either take the path of segment 1 or segment 2.