'Nextjs: Avoid change css className after run

This is my code:

<div className={styles.name}></div>

After run the app, in inspect element my class changed to this:

style_name__AYkko

How can I stop it?



Solution 1:[1]

The only way you can do what you want to do is importing your stylesheet inside _app.js to have it globally scoped and avoid using css-modules. At this point you can use your classes inside regular classNames without getting the unique hash on inspected elements

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 giosan