title: Trying to read an array from a file in React, but it comes up undefined
body: <p>I'm new to React and am working on a small project. I'm trying to figure out why React won't read the data from my dataArray.js file. It comes up undefined when I console.log it. I made sure the data was being exported, the data was connected to the App.js file, and I have the data listed in the state.</p>
  <p>I'm stumped as to what else to try.</p>
  <pre><code>import &quot;./styles.css&quot;;
  import { receiptsData } from &quot;./dataArray&quot;;
  import { Component } from &quot;react&quot;;
  import Receipt from &quot;./components/Receipt&quot;;
  
  class App extends Component {
    state = {
      receiptsData
    };
    render() {
      console.log(receiptsData);
      return (
        &lt;div className=&quot;App&quot;&gt;
          &lt;Receipt receipts={this.state.receiptsData} /&gt;
  
        &lt;/div&gt;
      );
    }
  }
  export default App;
  </code></pre>
  <p>I have a copy on condesandbox.io: <a href="https://codesandbox.io/s/korillaapp-0pm5y3" rel="nofollow noreferrer">https://codesandbox.io/s/korillaapp-0pm5y3</a></p>
  <p>I know I'm getting other errors as well, but I think it's tied to not being able to read the data from the dataArray.js file.</p>