ReactJs set className with string + variable

We have done lot of string and variable concatenation. But in Reactjs its quite different for New web developers. we can do it in many way like

render : function(){
	var newClass = "container "+{this.props.activeClass};
	return (<div className={newClass}></div>)
}

//Or

render : function(){
	return (<div className={"container " + this.props.activeClass}></div>)
}

Leave a Reply

Your email address will not be published. Required fields are marked *