I am using webpack with css loader. Everything works fine, except that I don't know how to use jQuery to select the css-loader class transformed. The converted class name looks something like this: "src-styleauthTextboxLeft1Npf4" with the following css-loader configuration:
css?sourceMap&modules&importLoaders=1&localIdentName=[path][name]__[local]__[hash:base64:5]'
Here is the reaction code
const Auth = (props) => { const toggle = (event) => { // Working example $('#container').css('background', 'blue'); // Not working $(styleCSS.container).css('background', 'green'); }; return ( <div id="container" className={styleCSS.container} onClick={toggle} /> ); };
Is there a way to make the second option work?
source share