我正在使用react-native-elements
带有 3 个按钮的 ButtonGroup。我需要在应用程序启动时禁用所有按钮,当满足条件时,我需要启用特定按钮。
我已经使用 false 标志禁用了所有按钮,但我不确定如何使用条件语句和状态启用特定按钮。
任何帮助,将不胜感激。
<ButtonGroup
onPress={this.updateIndex}
selectedIndex={selectedIndex}
buttons={buttons}
containerStyle={{ height: 100 }}
//disabled={[0, 1, 2]}
disabled={true}
/>
ADD_DETAILS(index) {
if (index === 0) {
console.log("clicked 0");
this.requestDetails();
}
}