title: exporting a react component as npm package
body: <p>Says I want to share a simple react component in npm package, to let others use it, must I do this?</p>
  
  <pre><code>import SomeComponent from './components/SomeComponent';
  
  module.exports = {
    SomeComponent: SomeComponent
  }
  </code></pre>
  
  <p>reference
  <a href="https://github.com/alanbsmith/npm-example-module/blob/master/lib/index.js" rel="noreferrer">https://github.com/alanbsmith/npm-example-module/blob/master/lib/index.js</a></p>
  
  <p>In package.json of the project you can see the main file of the package is build/index.js, but why the author don't just export <code>components/SomeComponent</code>, but instead created a wrapper? I understand he use babel, it's to support the code for legacy browser but why use module.exports in this case?</p>