title: How to create a privately shared component library which can be used across multiple react projects
body: <p><strong>Following Scenario</strong></p>
  
  <ul>
  <li>Project 1 needs to use <code>CustomButton.jsx</code></li>
  <li>Project 2 needs to use <code>CustomButton.jsx</code></li>
  </ul>
  
  <p><strong>Current Solution</strong></p>
  
  <p>Copy paste <code>CustomButton.jsx</code> into both Project 1 &amp; 2.</p>
  
  <p><strong>Desired Solution</strong></p>
  
  <ol>
  <li>Create Project 3 which includes <code>CustomButton.jsx</code></li>
  <li>Store Project 3 in a shared environment (like a public company directory e.g. <code>D://dev/react/my-component-library</code>)</li>
  <li>Install Project 3 via npm for Project 1 &amp; 2 and add dependency to <code>package.json</code> to keep consistency accross git clones.</li>
  <li>Import <code>CustomButton.jsx</code> with import statement in Project 1 &amp; 2: <code>import { CustomButton } from "my-component-library"</code></li>
  </ol>
  
  <p><strong>Questions</strong></p>
  
  <ol>
  <li>What kind of Project is Project 3? Is it build with <code>create-react-app</code> or which other tool can be used?</li>
  <li>How can I create a local/private npm package out of Project 3?</li>
  <li>How can I utilize a shared, local environment for that private package.</li>
  <li>How can I use the package in Project 1 &amp; 2?</li>
  </ol>
  
  <p>The components are fairly simple and don't contain complex logic.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>This shouldn't cost me anything (private npm does) or use 3rd party hosting, since I already have a privately shared environment/server/directory and I can host/store the packages there. </p>