I have a unique situation involving a component that utilizes CSS-Modules through the babel-plugin-react-css-modules plugin.
During certain points in the component's lifecycle, I need to calculate new dimensions by directly accessing the DOM.
Within my SCSS stylesheet, there is a class called .full-width that I need to temporarily apply to the component's DOM element for calculations before removing it.
Since adding and removing the class quickly does not impact the component or its state, I prefer to manipulate the class directly on the DOM without involving the component's state object.
When I use this.DOMReference.classList.add('full-width'), it adds the full-width class to the element. However, I want to add the modularized version of the class as applied by styleName="full-width" (e.g., Component__full-width___Pjd10)
Is there a way to achieve this without globally declaring .full-width?
Can react-css-modules help me with this scenario?