我试图使用三元运算符来响应原生 CSS,但它不起作用。有没有这样的方法让它起作用?
text: {
fontSize: 22,
textAlign: "center",
fontFamily: "Circular Std",
color: Text.name === "firstText" ? "#838383" : "#2EAA69"},
最佳答案
你不能在react-native组件的样式表中做三元运算符, 但是有一个替代方案叫做 "Styled component"
关于css - 如果我可以使用三元运算符来响应原生 CSS?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57227250/