为什么当project_id不为null时更改状态的任何属性时,为什么在不按TouchableOpacity的情况下随时激活此onPress吗?
<TouchableOpacity
onPress={() => {
if (this.state.feedback.project_id != null) {
this.setModalVisible(true);
} else {
Alert.alert('Select a project please');
}
}}>
<View>
<Text>SEND NOW</Text>
</View>
</TouchableOpacity>
示例过程: