title: Is it possible to refer to css styles as objects in JS code?
body: <p>I want to be able to do this:</p>
  
  <pre><code>import styles from 'switchstyle.css';
  
  const Choice = function (props) {
      const cssClasses = [];
  
      if (props.active) {
          // i think .active would be defined in the css file
          cssClasses.push(style.active);
      }
  
      return (
          &lt;div
              onClick={props.onClick}
              className={cssClasses}
          &gt;
              {props.label}
          &lt;/div&gt;
      );
  };
  </code></pre>
  
  <p>I saw something like that in a React book, but I cant get it to work -- I think I am missing some webpack plugin (I am guessing).   THank you</p>