title: How to populate countryList data in Form.Select in react js
body: <p>I have a data file that contains a list of all countries and I want these countries to populate in a select input similar to what we see on popular websites when a user logs in and visits his profile page to edit his information such as name, address and country.</p>
  <p>but when I run my code it doesn't seem to populate anything.</p>
  <p>what am I doing wrong?</p>
  <p>here is my code:</p>
  <p>data.js</p>
  <pre><code>export const countryList = [
      &quot;Afghanistan&quot;,
      &quot;Albania&quot;,
      &quot;Algeria&quot;,
      &quot;American Samoa&quot;,
      &quot;Andorra&quot;,
      &quot;Angola&quot;,
      &quot;Anguilla&quot;,
      &quot;Antarctica&quot;,....,....,.....]
  </code></pre>
  <p>profile.js:</p>
  <pre><code>    import { countryList, documentList,shipmentPurposeList } from &quot;../LocalData/data&quot;
      import React, {Component, useState, useEffect} from 'react';
        const [country,setCountry] = useState([]);
      
        useEffect(() =&gt; {
              Axios.get('http://localhost:3001/login').then((response) =&gt; {
      
                  if(response.data.loggedIn == true){
              
                   setCountry(countryList);
                  }
              });
          },[]);
  
  
       return (
  
        &lt;Row&gt;
                        &lt;Col md={11}&gt;
                            &lt;Form.Group controlId=&quot;exampleForm.ControlInput1&quot;&gt; 
                            &lt;Form.Label className={'font-12 mt-3 color-gray inputLabel'}&gt;Country&lt;/Form.Label&gt;
                              &lt;Form.Select aria-label=&quot;Select Title&quot;&gt;
  
                                    { country.map((item, i) =&gt; {
                                                   
                                       &lt;option key={i} value={item}&gt;
                                        {item}
                                        &lt;/option&gt;
                                       
                                       })
                                     }
                                    &lt;/Form.Select&gt;
                                   &lt;/Form.Group&gt;
                               &lt;/Col&gt;
                            &lt;/Row&gt;
  )
  </code></pre>