<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="function Component({reportType}) {
  let Report = Reports[reportType];
  let child = useMemo(() =&gt; {
    return &lt;Report /&gt;;
  }, [Report]);"><pre class="notranslate"><code class="notranslate">function Component({reportType}) {
  let Report = Reports[reportType];
  let child = useMemo(() =&gt; {
    return &lt;Report /&gt;;
  }, [Report]);
</code></pre></div>
<p dir="auto">says that <code class="notranslate">Report</code> is an unnecessary dependency. It's not.</p>
<p dir="auto">This is because eslint scope <code class="notranslate">.references</code> does not include JSX. I <em>suspect</em> if you pull in</p>
<p dir="auto"><a href="https://github.com/yannickcr/eslint-plugin-react/blob/master/lib/rules/jsx-uses-vars.js">https://github.com/yannickcr/eslint-plugin-react/blob/master/lib/rules/jsx-uses-vars.js</a></p>
<p dir="auto">to your app's config then this won't happen. But maybe we should do something in the Hooks plugin itself too (since the others aren't officially recommended by the React team anyway).</p>
<p dir="auto"><strong>Current behavior:</strong></p>
<p dir="auto">I have some <code class="notranslate">@mycomponents</code> in another place from project which depends on react and react-dom. For this components i use react hooks. After editing any of component i use <code class="notranslate">npm link</code>, and in project i use <code class="notranslate">npm link @mycomponents/core</code> and project crushes with this error:</p>
<p dir="auto"><code class="notranslate">Uncaught Invariant Violation: Invalid hook call. Hooks can only be called inside of the body of a function component.</code></p>
<p dir="auto">I was trying to publish <code class="notranslate">@mycomponents</code> in my repository and after publishing i run <code class="notranslate">npm install</code> and all works correct from node_modules.</p>
<p dir="auto">Probably problem with npm link</p>
<p dir="auto"><strong>Expected behavior</strong></p>
<p dir="auto">npm link works correctly with hooks</p>
<p dir="auto"><strong>Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?</strong></p>
<p dir="auto">react: v16.8.6<br>
react-dom: v16.8.6<br>
browser: Google chrome Version 73.0.3683.103 (Official Build) (64-bit)</p>