title: ReactJS export const and component from one module
body: <p>I have two modules that I want to share a const array. One of these modules includes both the const array and a component, whilst the other module only includes a component.</p>
  
  <p>This is what I have in module "A".</p>
  
  <pre><code>export const ORDER_COLUMNS = [
    { name: 'orderNumber', title: 'Order', width: '10%',  type: 'string' },
    { name: 'orderType', title: 'Type', width: '10%',  type: 'string' }
  ];
  
  class OrderGridControl extends React.Component {
    constructor(props) {
      super(props);
      this.state = {
          orderColumns: ORDER_COLUMNS
      };
    }
    ...
  
  }
  
  export default OrderGridControl;
  </code></pre>
  
  <p>And in module "B".</p>
  
  <pre><code>import {OrderGridControl, ORDER_COLUMNS} from 'component/order-grid-control';
  
  class OrderQueryPage extends React.Component {
        constructor(props) {
      super(props);
      this.state = {
          orderColumns: ORDER_COLUMNS
      };
      console.info(this.state.orderColumns);
    }
  
    ...
  
    render() {
      return (
        &lt;div&gt;
          &lt;PropertyGrid gridSetup={this.state.orderColumns} /&gt;
        &lt;/div&gt;
      );
    }
  }
  </code></pre>
  
  <p>When I run this I get the following error. <code>invariant.js:39 Uncaught Invariant Violation: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. Check the render method of 'moduleB'.</code></p>
  
  <p>However, the <code>console.info(this.state.orderColumns)</code> line logs all the column objects I expect.</p>
  
  <p>Interestingly, if I copy the array into module "B" and assign the columns in the constructor exactly the same way it seems to work. It only seems to be an issue when I'm importing from the other module.</p>