title: How to Concatenate an image source path
body: <p>i am making a language translation application, and i have the following code</p>
  
  <pre><code>var setInputLang = (item) =&gt; {
      this.state.inputLang= item;
      this.inputLangPic = //code here;
  }
  
  ///This is called within a view in my render function
  &lt;TouchableOpacity //Code here to set country   &gt;
      &lt;Image
          source = {require('../img/flags/png/india.png')}
          style = {{flex: 0.33,  height: 50, margin:10}}
      /&gt;
  &lt;/TouchableOpacity&gt;
  </code></pre>
  
  <p>Basically, i want to be able to, when the image is pressed, i want to set the input language's picture path to whatever the image is that is being pressed</p>
  
  <p>I have multiple flags to choose from, and storing the inputLang would need to work for all of these. This is what i was planning on doing</p>
  
  <pre><code>this.inputLangPic = {require('../img/flags/' + inputLang + '.png')}
  </code></pre>
  
  <p>This does not work, i was wondering how to do this? The current code gives me an error saying "Unknown named module: '../img/flags/png/india.png', which is odd because i've used this before to generate the image and it works just fine</p>
  
  <p>Thanks in advance</p>
  
  <p>EDIT: also, how would i go about passing the variable into the inputLang from touchable opacity? I have marked where this is as "//Code here to set country"</p>