【发布时间】:2018-12-27 16:24:27
【问题描述】:
如果在 react-native 中选中了特定复选框,我如何取消选中所有其他复选框
这是我的代码:
constructor(props, context) {
super(props, context);
console.log('custom/ccheckbox/index.js constructor()');
this.state = {
checked: false,
};
}
handleCheck() {
this.setState({checked: !this.state.checked});
}
render() {
return (
<CheckBox
iconType='material'
checkedIcon='check'
uncheckedIcon='check-box-outline-blank'
checkedColor={Colors.ORANGE}
checked={this.state.checked}
containerStyle={style.content}
onPress={() => this.handleCheck()}
/>
);
}
}
如何在句柄检查中使用 if else?
【问题讨论】:
标签: react-native