title: Call this.props inside map
body: <pre><code>var ElementList = React.createClass({render: function() {
          var x = this.props.icon;
          return (
             {this.props.data.map(function(value,i) {return (      
                  &lt;span key={i} className={ "fa " + x } data-id={value.id} &gt;&lt;/span&gt;             
              )})}
      );}});
  </code></pre>
  
  <p>How can I directly use this.props.icon inside the map function. Instead of using the x variable and declaring it outside.</p>