【发布时间】:2019-04-20 07:10:51
【问题描述】:
有人可以帮我比较反应原生的颜色对象吗? 一般来说,我会很快这样做:
if aColorObj == UIColorClass.white{
aColorObj = UIColorClass.gray
}
如何在下面的 react native 中做类似的事情:
onPressLearnMore() {
this.setState = {
/*
how to write this:
if mbackgroundColor == 'white'{
mbackgroundColor = 'red'
}else if mbackgroundColor == 'gray'{
mbackgroundColor = 'white'
}
*/
};
}
谢谢:)
【问题讨论】:
标签: react-native conditional state