We can use className prop on any HTML element but not an a custom react component. Requesting to support this feature as it simplifies the component usage when there is a need to apply additional styles without having to wrap the component in an external DIV.
//MyComponent
render() {
return <div className="message">Hello!</div>;
}
//expected usage
<MyComponent className="message--blue"/>
should render
<div className="message message--blue">Hello!</div>
This affect can be achieved by a mixin but non-mounted tests cannot use this.props.className to find the components.
componentDidMount() {
if (this.props.className) {
ReactDOM.findDOMNode(this).classList.add(this.props.className);
}
}