【发布时间】:2023-03-20 01:29:01
【问题描述】:
我想知道是否可以在没有任何 CSS 选择器的情况下创建上下文样式。
类似:
<Button primary>
<Text>BUTTON</Text> // if the button is primary then have 20px padding else 0
<Icon/> // if the button is primary then have red background
</Button>
我不想在这些方面使用 CSS 的原因是我想在 React Native 中分享我的组件(你没有任何选择器或 css)
【问题讨论】:
标签: css reactjs react-native styled-components