title: Warning: Failed prop type: The prop `leads` is marked as required in `Leads`, but its value is `undefined`
body: <p>I am trying this tutorial to display information into my table using React and Redux, but I keep on getting this error:</p>
  
  <blockquote>
    <p>Warning: Failed prop type: The prop <code>leads</code> is marked as required in
    <code>Leads</code>, but its value is <code>undefined</code>   Uncaught Type Error: Cannot
    read property 'map' of undefined Leads.js:52</p>
  </blockquote>
  
  <p>My code:</p>
  
  <pre><code>import React, { Component, Fragment } from "react";
  import { connect } from "react-redux";
  import PropTypes from "prop-types";
  import { getLeads } from "../../actions/leads";
  
  export class Leads extends Component {
  
    static propTypes = {
      leads: PropTypes.array.isRequired,
    };
  
    componentDidMount() {
      this.props.getLeads();
    }
  
    render() {
      return (
        &lt;Fragment&gt;
          &lt;h2&gt;Leads&lt;/h2&gt;
          &lt;table className="table table-striped"&gt;
            &lt;thead&gt;
              &lt;tr&gt;
                &lt;th&gt;ID&lt;/th&gt;
                &lt;th&gt;Name&lt;/th&gt;
                &lt;th&gt;Email&lt;/th&gt;
                &lt;th&gt;Message&lt;/th&gt;
                &lt;th /&gt;
              &lt;/tr&gt;
            &lt;/thead&gt;
            &lt;tbody&gt;
              {this.props.leads.map(lead =&gt; (
                &lt;tr key={lead.id}&gt;
                  &lt;td&gt;{lead.id}&lt;/td&gt;
                  &lt;td&gt;{lead.name}&lt;/td&gt;
                  &lt;td&gt;{lead.email}&lt;/td&gt;
                  &lt;td&gt;{lead.message}&lt;/td&gt;
                  &lt;td&gt;&lt;button className="btn btn-danger btn-sm"&gt;Delete&lt;/button&gt;&lt;/td&gt;
                &lt;/tr&gt;
              ))}
            &lt;/tbody&gt;
          &lt;/table&gt;
        &lt;/Fragment&gt;
      );
    }
  }
  
  const mapStateToProps = state =&gt; ({
    leads: state.leads.leads
  });
  
  export default connect(
    mapStateToProps,
    { getLeads }
  )(Leads); 
  </code></pre>
  
  <p>What am I doing wrong?</p>