React native onChangeValue在“中不起作用”;反应本机情态动词“;

React native onChangeValue在“中不起作用”;反应本机情态动词“;,react-native,React Native,我在模式中放置了一个可选的选择器。(react native modals)然后当我更改该选择器的值时,onChangeValue函数并没有像我预期的那样工作。当我更改值时,它会连续调用onChangeValue函数。如果我从modal中取出选择器,它工作得很好,但只在modal中工作。 如何在modal中更改选择器的值 <Modal width={0.9} visible={modalVisible} rounded actionsBordered onTouchOu

我在模式中放置了一个可选的选择器。(react native modals)然后当我更改该选择器的值时,onChangeValue函数并没有像我预期的那样工作。当我更改值时,它会连续调用onChangeValue函数。如果我从modal中取出选择器,它工作得很好,但只在modal中工作。 如何在modal中更改选择器的值

<Modal
  width={0.9}
  visible={modalVisible}
  rounded
  actionsBordered
  onTouchOutside={() => {
    this.close();
  }}
>
  <ModalContent style={{ backgroundColor: '#fff', alignItems: 'center', justifyContent: 'center' }} >
    <View style={{ marginTop: 15 }}>
      <RNPickerSelect
        placeholder={{ label: "Click Country...", value: 0 }}
        items={country}
        onValueChange={(value) => { this._onChangeModalCountry(value) }}
        value={country_id}
        Icon={() => {
          return <Image source={require('../assets/images/Icon.png')} style={{ width: 20, height: 20 }} />
        }}
      />
    </View>
  </ModalContent>
</Modal>

_onChangeModalCountry = (e) => {
  console.log('country', e);
}
为什么它仍然被称为?我只想打一次电话。即使我通过按“R”键刷新模拟器,它仍然被调用。原因是什么?如何更改模式中选择器的值

<Modal
  width={0.9}
  visible={modalVisible}
  rounded
  actionsBordered
  onTouchOutside={() => {
    this.close();
  }}
>
  <ModalContent style={{ backgroundColor: '#fff', alignItems: 'center', justifyContent: 'center' }} >
    <View style={{ marginTop: 15 }}>
      <RNPickerSelect
        placeholder={{ label: "Click Country...", value: 0 }}
        items={country}
        onValueChange={(value) => { this._onChangeModalCountry(value) }}
        value={country_id}
        Icon={() => {
          return <Image source={require('../assets/images/Icon.png')} style={{ width: 20, height: 20 }} />
        }}
      />
    </View>
  </ModalContent>
</Modal>

_onChangeModalCountry = (e) => {
  console.log('country', e);
}
I am using RN 0.63.2
"react-native-modals": "^0.19.9"
"react-native-picker-select": "7.0.0"