title: How to avoid `loaded two copies of React` error when developing an external component?
body: <p>I am developing an external component (let's say <code>my-component</code>, which I link to the project with <code>npm link</code> (as it is in process and I need the package to reflect changes).</p>
  
  <p>In the <code>my-component</code> folder there are <code>node_modules/react</code> and <code>node_modules/react-dom</code> as they are its dependencies. However they are peerDependences, so I did not suppose to bring them into the project linking this package.</p>
  
  <p>However when using <code>npm link</code>, it link the whole directory, including <code>node_modules</code>. So, when the project builds, it includes packages 2 times: from <code>node_modules/*</code> and from <code>node_modules/my-component/node_modules/*</code>.</p>
  
  <p>This begins to affect when the component is using <code>ReactDOM.findDOMNode</code>, it causes this error:</p>
  
  <pre><code>Warning: React can't find the root component node for data-reactid value `.0.2.0`. If you're seeing this message, it probably means that you've loaded two copies of React on the page. At this time, only a single copy of React can be loaded at a time.
  </code></pre>
  
  <p>Also, it may help to understand what's happening: the problem only appears if there are both <code>node_modules/my-component/node_modules/react</code> and <code>node_modules/my-component/node_modules/react-dom</code>. If there is only one of them, there is no error message.</p>
  
  <p>The usual package installation does not bring such error as there is no <code>node_modules/react-dom</code> there.</p>
  
  <p>How is it supposed to develop an external component and the project at the same time?</p>