简体   繁体   English

与 css styles 反应的传播样式

[英]spread style in react with css styles

I am looking for a way to override styles of a component using css className, this is what i've tried so far:我正在寻找一种使用 css className 覆盖组件的 styles 的方法,这是我迄今为止尝试过的:

<div
      style={{
        shadowColor: 'black',
        shadowOffset: { width: 0, height: 2 },
        shadowRadius: 6,
        shadowOpacity: 0.26,
        elevation: 8,
        boxShadow: '2px 5px 5px',
        border-color: 'white';

        ...props.style,
      }}>
      {props.children}
    </div>

and this is the css styles:这是 css styles:

.component_override {
    height: 600px;
    width: 400px;
    background-color: rgb(255, 255, 255);
    border-radius: 30px;
    border: solid;
    border-color: #000000;
}
border-color: 'white';

should be应该

borderColor: 'white',

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM