Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
247 views
in Technique[技术] by (71.8m points)

javascript - Normal string className in CSS module

Is there any way to write normal type className on React using css module. Like I want to write className="Foo Bar" avoiding className{ ${foo} ${bar} of CSS Module.

question from:https://stackoverflow.com/questions/65918213/normal-string-classname-in-css-module

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

className="Foo Bar" When you inspect the element then you can notice, the element has assigned the class Foo and Bar.

The way CSS module works, if you are assigning class Foo on any element, then you can inspect it has been assigned class like, Foo_asd113d3__random_string.

That's why className="Foo Bar" will not work in CSS module


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...