iari
03/15/2022, 2:27 PMclassName
?
Something between pre.294 and pre-320 changed, before I could jsut assign a string
className = "content-heading"
but now it expects a ClassName?
instance - whats the idiomatic way to instanciate them?
Do I just do
className = ClassName("content-heading")
?turansky
03/15/2022, 2:40 PMturansky
03/15/2022, 4:08 PMcontent-heading
class in your case?CLOVIS
03/15/2022, 5:22 PMCLOVIS
03/15/2022, 5:42 PMturansky
03/15/2022, 6:40 PMIt’s not even a real type…That is why it’s interface 🙂 cc @Sergei Grishchenko
turansky
03/15/2022, 9:00 PMiari
03/16/2022, 9:02 AMSergei Grishchenko
03/17/2022, 12:33 PMclassName
is always reference between CSS and HTML, so we try to encourage you to extract class names to variables and reuse them around your app instead of hardcoding them like string literals.
BUT we don't exclude that there are cases where such approach is not good, so @iari @CLOVIS if you think that this change was wrong and you have example why it is, please, let us know, we will try to discuss them.CLOVIS
03/19/2022, 9:55 PMCLOVIS
03/19/2022, 9:56 PMturansky
03/20/2022, 9:07 AMclassName = cx(m_4, px_8, shadow_lg, rounded_lg, z_10, relative, bg_white, color)
where m_4
, px_8
- predefined constants
P.S. cx
supports nullable class names