【发布时间】:2021-01-05 05:37:39
【问题描述】:
我创建了一个样式化组件
const StrikeThrough = styled(StandardText)`
textDecoration: line-through;
`;
并用孩子调用它,类似于<StrikeThrough>Write text here</StrikeThrough>,但呈现的文本没有这种装饰。为什么会这样?
编辑:我尝试过的其他方法不起作用
const StrikeThrough = styled(StandardText)`
textDecorationLine: line-through;
textDecorationStyle: solid;
`;
const StrikeThrough = styled(StandardText)`
text-decoration: line-through;
`;
编辑: 要回答我自己的问题,看来我必须在 Text 组件上执行此操作,并且无法在我的样式组件之上创建样式组件。
【问题讨论】:
标签: css react-native mobile styles