【发布时间】:2021-07-22 14:24:10
【问题描述】:
<Text
style={[
styles.buttonLabel,
selectedValue === value && styles.selectedLabel,
]}
>{value}</Text>
以上是从react-native flexbox官方文档的第二个示例中提取的一段代码。谁能解释style prop 中表达式的功能?
【问题讨论】:
-
请在帖子中描述您的问题。不要在主题中这样做。请阅读stackoverflow.com/help/how-to-ask
-
不要把问题的核心放在标题中
-
教程:reactjs.org/docs/faq-styling.html 指向这些文档reactjs.org/docs/dom-elements.html#style,有了这些基本知识,您只需要弄清楚数组内部的真值检查是如何工作的
-
当然,会尝试更好地起草这个问题。这是我的第一个问题,不知道规范。
标签: javascript reactjs react-native