title: Cannot read property 'map' of undefined, why?
body: <p>This is my App.js file. I am trying to fetch data using fetch()
     What am I missing? Getting Error as TypeError: Cannot read property 
     map of undefined". What is wrong? How do I get the result?<br>
     I'm following the reactjs tutorial, and I keep running into an issue 
     when passing the value from the state of one component into another 
     component. The error 'Cannot read property 'map' of undefined' is thrown 
     when the map function in the CommentList component is executed. What 
     would cause the prop to become undefined when fetching data? I also 
     tried putting debugger, why it is not going inside the fetch call?</p>
  
  <pre><code>import React, { Component } from 'react';
  import UsingFetch from './UsingFetch'; 
  
  class App extends Component {
    constructor(props){
      super(props);
      this.state = {
        companyList:[]
      };
    }
  
    componentDidMount(){
      fetch('https://jsonplaceholder.typicode.com/users')
        .then(res =&gt; { res.json() })
        .then(
          res =&gt; {
            this.setState({
              companyList : res
            });
          },
          (error) =&gt; {
            this.setState({
              isLoaded: true,
              error
            });
          }
        )
    }
  
    render() {
      return (
        &lt;div className="App"&gt;
          1) DataGrid
          &lt;UsingFetch datasource = {this.state.companyList}/&gt;
        &lt;/div&gt;
      );
    }
  }
  
  export default App;
  </code></pre>
  
  <p>This is my UsingFetch.js File</p>
  
  <pre><code>class UsingFetch extends Component{
    constructor(){
      super();
      this.state = {
        isLoaded:false,
      }
    }
  
    render() {
      return (
        &lt;div&gt;
          {this.props.datasource.map(item =&gt;
            &lt;div&gt;
              {item.name}
            &lt;/div&gt;
          )}
        &lt;/div&gt;
      )
    }
  }
  </code></pre>
  
  <p>This is my App.js and UsingFetch.js file. I am trying to fetch data 
    using fetch(), What am I missing? Getting Error as:</p>
  
  <blockquote>
    <p>TypeError: Cannot read property    map of undefined"</p>
  </blockquote>
  
  <p>What is wrong? How do I get the result?      </p>