Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

How to add multiple classes to a ReactJS Component

var liClasses = classNames({
      'main-class': true,
      'activeClass': self.state.focused === index
    });

    return (<li className={liClasses}>{data.name}</li>);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #How #add #multiple #classes #ReactJS #Component
ADD COMMENT
Topic
Name
8+4 =