How to access data from file in react.js
<p>I am kind of stuck at the moment. I am trying to load data into one of my components and pass it to another component. However I am not able to access the data. I receive the following error: </p>

<p><strong>TypeError: data.map is not a function</strong></p>

<p>I believe that I am not accessing the imported data (import data from '../src/data/data') correctly when saving it into my <strong>const data</strong></p>

<p>This is what my component List.js looks like at the moment:</p>

<pre><code>import React, { Component } from 'react'
import Article from './Article'
require ('../src/sass/List.scss');
import data from '../src/data/data'

class List extends Component {

  render() {

    const data = {data}
    const listWebsites = data.map(websites =&gt; {

        return (
            &lt;Article key={websites.id} name={websites.name} preview={websites.description} image={websites.image} /&gt;
            )
    })

    console.log('our data is:', this.props.data)
    return (
      &lt;div className="wrapperList"&gt;
          {listWebsites}

        &lt;/div&gt;
    )
  }

}

export default List
</code></pre>

<p>This is my data file:</p>

<pre><code>const data = [
  {
    'id': '1',
    'name': 'Skyscanner',
    'description': 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr ',
    'image': 'skyscanner.png',

  },
  {
    'id': '2',
    'name': 'Momondo',
    'description': 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr  ',
    'image': 'monondo.jpg',

  },
  {
    'id': '3',
    'name': 'Skypicker',
    'description': 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr ',
    'image': 'Skypicker.jpg',

  },
  {
    'id': '4',
    'name': 'Atob',
    'description': 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr  ',
    'image': 'Atob.jpg',

  },
   {
    'id': '5',
    'name': 'flipper',
    'description': 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr ',
    'image': 'flipper.jpg',

  },

];

export default data;
</code></pre>

<p>Could you please help me to fix this and tell me how to access the data correctly? Thanks a lot</p>