title: How to make React component wait for http call to return
body: <p>I am learning react-redux-saga and I am making an HTTP call with saga.  I connect the result using mapStateToProps however, my react component errors out before the http call returns.  I get something along the lines of "Cannot find name of undefined" on the first line of my return statement.</p>
  
  <p>How do I get my component to wait?  this.props.user will be undefined for a split second while the http call is being made but the call never returns because my application just dies due to the runtime error.</p>
  
  <p>Here's the code I'm working with:</p>
  
  <pre><code>class ImageGenerator extends Component {
      constructor(props) {
          super(props);
      }
      render() {
          let user = this.props.image;
          console.log("USer", this.props.image);
          return (
              &lt;div&gt;
                  Name: {user.name.first} {user.name.last}
                  Phone: {user.phone}
                  Date of Birth: {user.dob.date} &lt;br/&gt;
                  Age: {user.dob.age} &lt;br/&gt;
                  Email: {user.dob} &lt;br /&gt;
                  Gender: {user.gender} &lt;br/&gt;
                  City: {user.location.city } &lt;br /&gt;
                  State: {user.location.State } &lt;br /&gt;
                  Street: {user.location.street } &lt;br /&gt;
                  &lt;img src={user.picture.medium} alt="No Image Found"/&gt;
                  {/* &lt;button onClick={getNewImage}&gt;New Image&lt;/button&gt; */}
                  &lt;button&gt;Add to Favorites&lt;/button&gt; 
             &lt;/div&gt;
          )
      }
  }
  
  const mapStateToProps = state =&gt; {
      console.log("State", state);
      return { image: state.image };
  };
  
  const mapDispatchToProps = dispatch =&gt; {
      return {
          getNewImage: () =&gt;
              dispatch({
                  type: NEXT_IMAGE
              })
      }
  };
  
  export default connect(mapStateToProps, mapDispatchToProps)(ImageGenerator);
  </code></pre>