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(
pill ${this.props.styleName} will get "pill undefined" when you don't set the props
pill ${this.props.styleName}
I prefer
className={ "pill " + ( this.props.styleName || "") }
or
className={ "pill " + ( this.props.styleName ? this.props.styleName : "") }