【发布时间】:2019-08-21 16:23:23
【问题描述】:
我希望在点击 touchableopacity 时,我的应用将模态状态更改为 false
constructor(props) {
super(props);
this.state = {
modalVisible: true,
first: true,
}
}
checkIfFirstLog = () => {
this.setState = {first: false}
if (this.state.first = false) {
this.setState = {
modalVisible: false
}
}
}
<Modal
<TouchableOpacity onPress={() => this.checkIfFirstLog() }>
</TouchableOpacity>
</Modal>
【问题讨论】:
标签: function react-native if-statement mobile modalviewcontroller