Css Text装饰:在React本机样式的组件中不工作的行通过
我创建了一个样式化组件Css Text装饰:在React本机样式的组件中不工作的行通过,css,react-native,mobile,styles,Css,React Native,Mobile,Styles,我创建了一个样式化组件 const StrikeThrough = styled(StandardText)` textDecoration: line-through; `; 并将其称为子级,类似于在此处编写文本,但呈现的文本没有这种装饰。为什么会这样 编辑:我尝试过的其他不起作用的东西 const StrikeThrough = styled(StandardText)` textDecorationLine: line-through; textDecoratio
const StrikeThrough = styled(StandardText)`
textDecoration: line-through;
`;
并将其称为子级,类似于在此处编写文本
,但呈现的文本没有这种装饰。为什么会这样
编辑:我尝试过的其他不起作用的东西
const StrikeThrough = styled(StandardText)`
textDecorationLine: line-through;
textDecorationStyle: solid;
`;
编辑:
回答我自己的问题,,看起来我必须在文本组件上做,不能在我的样式组件上做样式组件。使用
文本装饰
而不是文本装饰您使用的是样式组件,因此使用文本装饰而不是文本装饰并使用点而不是括号:
常量删除线=styled.Text`
text-decoration: line-through;
`
text-decoration: line-through;