title: Solve having more than one copy of React in the same app
body: <p>I'm developing a React module locally. For that, I'm linking my module using <code>npm link</code>.
  The module is imported successfully but hooks are failing inside the module. It's throwing the following error:</p>
  <blockquote>
  <p>Invalid hook call. Hooks can only be called inside of the body of a
  function component. This could happen for one of the following
  reasons: 1. You might have mismatching versions of React and the
  renderer (such as React DOM) 2. You might be breaking the Rules of
  Hooks 3. You might have more than one copy of React in the same app
  See <a href="https://reactjs.org/link/invalid-hook-call" rel="noreferrer">https://reactjs.org/link/invalid-hook-call</a> for tips about how to
  debug and fix this problem.</p>
  </blockquote>
  <p>Checking the suggestions at <a href="https://es.reactjs.org/warnings/invalid-hook-call-warning.html" rel="noreferrer">React docs</a>, I can confirm my app is using duplicate versions of React since the following code returns false:</p>
  <pre class="lang-js prettyprint-override"><code>// node_modules/mymodule/src/index.js
  export { default as ReactFromModule } from 'react'
  </code></pre>
  <pre class="lang-js prettyprint-override"><code>// src/index.js
  import React from 'react'
  import { ReactFromModule } from 'mymodule'
  console.log(React === ReactFromModule) //false
  </code></pre>
  <p><a href="https://github.com/facebook/react/issues/13991" rel="noreferrer">This issue</a> is full of suggestions but they are confusing. How can I solve it?</p>
  <p>Note: Im not breaking rules of hooks, the error appears only when importing the module from an application.</p>