title: Cannot access {variable-name} before initialization (React import)
body: <p>I'm getting a Reference Error</p>
  <blockquote>
  <p>Cannot access 'STRUCTURE_COLUMN_ID' before initialization</p>
  </blockquote>
  <p>I have a structureColumn file which contains the following:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>import React from 'react';
  import Column from './column';
  
  export const STRUCTURE_COLUMN_ID = 'Structure';
  
  export default class StructureColumn extends Column {
    constructor(name) {
      super(STRUCTURE_COLUMN_ID);
    }
  
    clone() {
      return new StructureColumn(this.name);
    }
  
    getKey() {
      return STRUCTURE_COLUMN_ID;
    }
  }</code></pre>
  </div>
  </div>
  </p>
  <p>When trying to access <code>StructureColumn</code> class or <code>STRUCTURE_COLUMN_ID</code> variable from a component I get the mentioned error.</p>
  <p>The component looks the following:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>import React from 'react';
  import { List, ListItem, Tooltip } from '@material-ui/core';
  import { STRUCTURE_COLUMN_ID } from '../../../../models/structureColumn';
  
  console.log(STRUCTURE_COLUMN_ID);
  
  const CustomColumnsList = ({ onSelect }) =&gt; {
    return (
      &lt;List&gt;
        {Object.values({}).map(col =&gt; (
          &lt;Tooltip title={col.description}&gt;
            &lt;ListItem onClick={() =&gt; onSelect(col.column)} button&gt;
              {col.name}
            &lt;/ListItem&gt;
          &lt;/Tooltip&gt;
        ))}
      &lt;/List&gt;
    );
  };
  
  export default CustomColumnsList;</code></pre>
  </div>
  </div>
  </p>
  <p>I can use the variable inside the functional component body but the thing is I wanted to create a constant variable out of it's scope. Never seen this issue before in React. Someone has an experience dealing with it?</p>