我试图将类名传递给react组件以更改其样式,但似乎无法正常工作:
class Pill extends React.Component {
render() {
return (
<button className="pill {this.props.styleName}">{this.props.children}</button>
);
}
}
<Pill styleName="skill">Business</Pill>
我试图通过传入具有相应样式的类的名称来更改pill的样式.我是新来的,所以可能我做得不对.谢谢