Empty ClassName
You can return null instead of the empty string:
return (
<div className={this.state.foo ? 'active' : null }></div>
)
You could probably do
var props = {};
if (this.state.foo) {
props.myClass = 'active';
}
return (
<div {...props}></div>
);