Adding Dynamic Class Name To List Of Hard Coded Classes In React
I have an element with a list of classes e.g.
Content
And I want to add this react variable to the list of classes: {this.statSolution 1:
you can do the following using template strings:
<div className={`${this.state.active ? 'is-active': ''} class1 class2 class3`}>Content</div>
Post a Comment for "Adding Dynamic Class Name To List Of Hard Coded Classes In React"