【发布时间】:2023-04-06 04:35:02
【问题描述】:
我在我的 CSS 中使用 react native Platform API 作为三元运算符。
比如我在设置高度:
height: Platform.OS === 'ios' ? 40 : 50,
但有时我想在一种情况下设置属性,但在另一种情况下却不想:
height: Platform.OS === 'ios' ? 40 : <Don't set height>
实现这一点的正确逻辑是什么?
【问题讨论】:
标签: javascript css react-native