title: React: conditional statement in render function
body: <p>I have an array of objects with different artists. I want to show different content based on whether or not an image is in the individual object.</p>
  
  <p>I have tried to put an <code>if/else</code> statement in my render method, but of course this is not working. Please see my code below.</p>
  
  <pre><code>render: function() {
      var cardList = this.props.artists.map(function(artist, index){
          return(
            &lt;li key={index} className='card'&gt;
              &lt;span&gt;  
                  {if artist.image}
                     &lt;img src="{artist.image}"&gt;
                  {else}
                  &lt;p&gt;{artist.message}&lt;/p&gt;
                    &lt;p&gt;LIKES &lt;i className="fa fa-heart" aria-hidden="true"&gt;&lt;/i&gt; {artist.likeCount }&lt;/p&gt;
                &lt;/span&gt;
            &lt;/li&gt;
          )
      })
      return (
        &lt;div className='tickerwrapper'&gt;
          &lt;ul className='list'&gt;{cardList}&lt;/ul&gt;
        &lt;/div&gt;
      )
    }
  </code></pre>