Struggling to incorporate a variable into a CSS module class name in Next.js. Finding it challenging to determine the correct syntax.
The variable is fetched from the API:
const type = red
Here's how I'm attempting to achieve it:
<div className={` ${styles.background} ${styles.--type}`}></div>
The desired outcome:
<div className={` ${styles.background} ${styles.--red}`></div>
Any suggestions on how to accomplish this?