I am trying to pass in a classname to a react component to change it's style and cannot seem to get working:
class Pill extends React.Component {
render() {
return (
<button className="pill {this.props.styleName}">{this.props.children}</button>
);
}
}
<Pill styleName="skill">Business</Pill>
I am trying to change the style of the pill by passing in the name of the class that has the respective style. I am new to React so maybe I am not doing this the right way. Thanks
See Question&Answers more detail:os