Why using "clsx" ? #4668
Unanswered
AbdullahSoomroOfficial
asked this question in
Q&A
Replies: 1 comment 1 reply
-
As mentioned in tailwind-merge doc here, So
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
tailwind-merge uses twJoin to join class strings together, ensuring there are no conflicting classes. This means that twMerge already handles class merging efficiently by utilizing twJoin.
Given this, why would we use twMerge(clsx()), which essentially performs the class joining task twice? Wouldn't using clsx alongside twMerge be redundant?
twJoin has the same performance characteristics as other class joining libraries like clsx
Beta Was this translation helpful? Give feedback.
All reactions