首页 > 解决方案 > 如何在 React Native withTypescript 中定位和设置样式组件之间的样式

问题描述

我想像往常一样在 React with Styled Components 中做。

import styled from "styled-components";

import {Wrapper as CardComponent} from '../../components/Card/style';

export const Wrapper = styled.div`
 ${CardComponent}{
 ...the styles
}
`

但这不适用于 React Native。

import styled from "styled-components/native";

import {Wrapper as CardComponent} from '../../components/Card/style';

export const Wrapper = styled.View`
 ${CardComponent}{
 ...the styles
}
`

有什么方法可以在反应原生的样式组件之间定位和设置规则?

标签: csstypescriptreact-nativestyled-components

解决方案


推荐阅读