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>);
 
PREVIOUS NEXT
Tagged: #How #add #multiple #classes #ReactJS #Component
ADD COMMENT
Topic
Name
5+1 =