title: How to load API response Data into DropDown in React Native Expo?
body: <p>This is my JSON Response Data. I have to load it in a Picker which is used for DropDown. This Data I am getting in a function.</p>
  
  <pre><code>{
      "api_res_key": "5678",
      "res_data": [
          {
              "course_code": "ICAJE",
              "course_name": "Induction Course for AJE"
          }
      ],
      "res_status": "200",
      "res_msg_code": "VALID",
      "res_message": "Course list selected"
  }
  </code></pre>
  
  <p>This is my code for DropDown in react native expo app. Please suggest me How to handle this</p>
  
  <pre><code>&lt;Picker
        selectedValue={this.state.DropdownData}
        onValueChange={(itemValue, itemIndex) =&gt; 
            this.setState({DropdownData: itemValue})}&gt;
  
        // Dynamically loads Picker.Values from this.state.userTypes.
  
        {this.DropdownData()}
      &lt;/Picker&gt;
  </code></pre>
  
  <p>This is my function which loads the Data</p>
  
  <pre><code>DropdownData(){
  
              fetch('https://hashtaglabs.in/stctrain/api/master-access.php?api_key=1234&amp;action=get_session_courses', {
                  method: 'get',              
                  header: {
                      'Accept': 'application/json',
                      'Content-type': 'application/json'
                  },          
  
              })
                  .then((response) =&gt; response.json())
                  .then(async (responseJson) =&gt; {
  
  
                      if (responseJson.res_status == "200") {
                          console.log(responseJson.res_data);     
                          this.showLoader();
                          try {
                              await AsyncStorage.setItem("key", JSON.stringify(responseJson.res_data));
  
  
                          } catch (error) {
                              Alert.alert('Error', 'There was an error.')
                              alert("Unsuccessful");
                          }
  
  
  
                      } else {
                          console.log(responseJson.res_message);
                          alert(responseJson.res_message);
  
                      }
                  })
                  .catch((error) =&gt; {
                      console.error(error);
                  });
          }
  </code></pre>