How to replace css modules classes in js files without a templator
Hello,
Could you someone please provide an example how to insert generated modules into js files?
Using docs I built css modules and I saw examples for html and templators but want to keep my js files clean of special template syntax. In my case I'm building React app and when I converted css into modules I updated import in components to import styles from "./MyComponent.module.css"; and class assignment statements <div className={styles.myClass}>. After transpiling it was turned into { className: MyComponent_module_css_1.default.myClass }. What would be the best approach to replace such generated styles or it's done somehow differently?
Post title is wrong. He is asking how to use cssmodules in js files wthout templator. Replacing classes in JS is another task in which i am still very interested. How to change css-classes in js files ?