React native 使用react原生和样式化组件如何更改子道具?
我需要更改TouchableHighlight样式组件中的React native 使用react原生和样式化组件如何更改子道具?,react-native,styled-components,React Native,Styled Components,我需要更改TouchableHighlight样式组件中的颜色。已尝试: const Button = styled.TouchableHighlight` width: 100%; justify-content: center; background-color: #337ab7; Text { color: orange; } `; 没有起作用。。。此外,此Text来自react native,而不是样式化组件。为Text创建
颜色。已尝试:
const Button = styled.TouchableHighlight`
width: 100%;
justify-content: center;
background-color: #337ab7;
Text {
color: orange;
}
`;
没有起作用。。。此外,此
Text
来自react native,而不是样式化组件。为Text
创建单独的样式组件
// styled component
const StyledText = styled.Text`
color: orange;
`;
并在代码中使用StyledText
而不是Text