title: Use image as icon with react-select
body: <p>I would like to add an image as Icon with react-select. I did all right but I have a problem with the fact that, in react, images are written like this :</p>
  
  <pre><code>&lt;img src={require(...)} /&gt;
  </code></pre>
  
  <p>So I use react-select like this :</p>
  
  <pre><code>const IconOption = (props) =&gt; (
  
    &lt;Option {... props}&gt;
      &lt;div&gt;
        &lt;img src={require(props.data.image)} /&gt;
      &lt;/div&gt;
    &lt;/Option&gt;
  );
  </code></pre>
  
  <p>And then call for the select box :</p>
  
  <pre><code>render() {
      return (
        &lt;Select
          classNamePrefix="react-select"
          placeholder={"Search..."}
          onChange={this.handleChange}
          components={{ DropdownIndicator: () =&gt; null, Option: IconOption }}
          options={this.state.options}
          openMenuOnClick={false}
          styles={customStyle}
        /&gt;
      );
    }
  </code></pre>
  
  <p>I tried to write :</p>
  
  <pre><code>const IconOption = (props) =&gt; (
  
    &lt;Option {... props}&gt;
      &lt;div&gt;
        {props.data.image}
      &lt;/div&gt;
    &lt;/Option&gt;
  );
  </code></pre>
  
  <p>Which gives me :</p>
  
  <pre><code>./css/img/PROFILEPICTURE.jpg
  </code></pre>
  
  <p>It is exactly what I want to get, the path is correct. If I exactly write :</p>
  
  <pre><code>const IconOption = (props) =&gt; (
  
    &lt;Option {... props}&gt;
      &lt;div&gt;
        &lt;img src="./css/img/PROFILEPICTURE.jpg" /&gt;
      &lt;/div&gt;
    &lt;/Option&gt;
  );
  </code></pre>
  
  <p>Image is correctly displayed.</p>
  
  <p>If I write the first code, which is the one to get different picture for each item in selectbox, I got an error :</p>
  
  <p><a href="https://i.stack.imgur.com/I9lD3.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/I9lD3.jpg" alt="enter image description here"></a></p>
  
  <p>Any solution to not use require function for img in react?</p>
  
  <p>Edit :</p>
  
  <p>I also tried :</p>
  
  <pre><code>const IconOption = (props) =&gt; 
    (
      &lt;Option {... props}&gt;
        &lt;div&gt;
          &lt;img src={props.data.image} /&gt;
          {props.data.label}
        &lt;/div&gt;
      &lt;/Option&gt;
    );
  </code></pre>
  
  <p>And i got not found images :</p>
  
  <p><a href="https://i.stack.imgur.com/oDZI7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/oDZI7.png" alt="enter image description here"></a></p>