title: React Native Picker onValueChange Problem
body: <p>I am really new to React Native. My component was working fine with just 1 picker. However, after I added one more picker the code became complicated.</p>
  <p>The data of the second picker depends on the selected value of first picker, since I put that value as a parameter on api url. I tried to write a function to trigger second picker every time the user changes the first picker's value. But now even my first picker's <code>onValueChange</code> does not work. Can you help me to find a right solution?</p>
  <p>Code:</p>
  <pre><code>import React, {useState, useEffect} from 'react';
  import axios from 'axios';
  import {
    StyleSheet,
    Text,
    View
  } from 'react-native';
  
  import {Picker} from '@react-native-picker/picker';
  
  
  const VeriGuncelleme = ({route}) =&gt; {
      
      const { responseData } = route.params;
      const {kullaniciBilgisi} = route.params; 
  
      var bolge = responseData.items[0].bolge; 
      var etiket_no = responseData.items[0].etiket_no;
      var marka = responseData.items[0].uretici;
      var model = responseData.items[0].model;
      var serino = responseData.items[0].serino;
      var ad_soyad = responseData.items[0].ad_soyad;
      var varlik_turu = responseData.items[0].varlik_turu;
  
  
      const [selectedValueMarka, setSelectedValueMarka] = useState(marka);
      const url_marka = &quot;--url here--&quot; +varlik_turu;
  
      
      var marka_arr_new=[];
      const [marka_arr, setMarkaArr] = useState([]);
  
        axios.get(url_marka) 
        .then(res =&gt; {
          
          for(var i =0; i&lt;res.data.items.length; i++){
            marka_arr_new.push(res.data.items[i].d);
          }
      
          setMarkaArr(marka_arr_new);
  
        })
  
  
        const [selectedValueModel, setSelectedValueModel] = useState(model);
  
  
       
        var model_arr_new=[];
        const [model_arr, setModelArr] = useState([]);
  
        const AfterMarkaChange = (itemValue) =&gt;{
          setSelectedValueMarka(itemValue);
          ModelGetir;
        }
  
        const url_model = &quot; --url here-- &quot;+varlik_turu+&quot;/&quot;+selectedValueMarka; //selectedValueMarka came from first picker
  
        const ModelGetir = () =&gt; {
        
          axios.get(url_model) 
           .then(res =&gt; {
           
           for(var i =0; i&lt;res.data.items.length; i++){
           model_arr_new.push(res.data.items[i].d);
          }
  
           setModelArr(model_arr_new);
  
          })
        
        }
  
  
      return (
  
        &lt;View style={styles.container}&gt;
          &lt;View &gt;
             &lt;Text style={{fontWeight:'bold', padding:8}}&gt;Etiket No        :  {etiket_no}&lt;/Text&gt;
             &lt;Text style={{fontWeight:'bold', padding:8}}&gt;Marka             :&lt;/Text&gt;
             &lt;Text style={{fontWeight:'bold', padding:8}}&gt;Model             :&lt;/Text&gt;
             &lt;Text style={{fontWeight:'bold', padding:8}}&gt;Seri No           :&lt;/Text&gt;
             &lt;Text style={{fontWeight:'bold', padding:8}}&gt;Bölge              :&lt;/Text&gt;
          &lt;/View&gt;
          &lt;View&gt;
            &lt;Picker 
              selectedValue={selectedValueMarka}
              style={{ height: 50, width: 150 }}
              onValueChange={AfterMarkaChange}&gt;
  
              { marka_arr.map((value,index) =&gt; {
                   return &lt;Picker.Item label={value} value={value} key={index} /&gt;}) }   
  
            &lt;/Picker&gt;   
            &lt;Picker
              selectedValue={selectedValueModel}
              style={{ height: 50, width: 150 }}
              onValueChange={(itemValue, itemIndex) =&gt; setSelectedValueModel(itemValue)}&gt;
  
              { model_arr.map((value,index) =&gt; {
                   return &lt;Picker.Item label={value} value={value} key={index} /&gt;}) }   
  
            &lt;/Picker&gt;   
    
    
          &lt;/View&gt;
      &lt;/View&gt;
      );
    }
  export default VeriGuncelleme;
  </code></pre>