<div className={this.state.like===true?"icon-active ":""+"icon-box"} onClick={this.clickToLike}>
<i className="iconfont icon-dianzan"></i>
</div>
as above, I want to have both the default class and how to add a dynamic class, according to the variable in className. Now the result is that if icon-active is added, then the following class is gone.
if I write the default class first, I won"t be able to display the style directly.
<div className={"icon-box"+" "+this.state.like===true?" icon-active":""} onClick={this.clickToLike}>
<i className="iconfont icon-dianzan"></i>
</div>