How could I convert this className:
className={`Tooltip__message Tooltip__message--${position}`}
to a css Module className?
There are two classes, and one concatenates a variable.
How could I convert this className:
className={`Tooltip__message Tooltip__message--${position}`}
to a css Module className?
There are two classes, and one concatenates a variable.
You can either do this, normal JavaScript:
className={'wrapper searchDiv ' + this.state.something}
or the string template version, with backticks:
className={`wrapper searchDiv ${this.state.something}`}
Both types are of course just JavaScript, but the first pattern is the traditional kind.
Anyway, in JSX, anything enclosed in curly brackets is executed as JavaScript, so you can basically do whatever you want there. But combining JSX strings and curly brackets is a no-go for attributes.