【发布时间】:2019-04-21 14:06:09
【问题描述】:
我正在尝试通过样式化组件添加背景颜色。
如果通过 style={} 属性添加样式,它会按预期工作,但如果我在我的样式组件文件中添加相同的样式,它就不会工作。
//this is working
<MyStyle style={{backgroundColor: '#fff' }}>
//some component here
</MyStyle>
//This is not working.
export const MyStyle = styled.div`
background-color: ‘#fff’;
`;
有人能指出我在这里缺少什么吗?
【问题讨论】: