Skip to content

Do I need both clsx and twMerge? #379

Closed Answered by dcastil
markomitranic asked this question in Help
Discussion options

You must be logged in to vote

Yes, you are right. I believe some people wanted to use the object syntax which tailwind-merge doesn't support and then everyone else copied that piece of code. 😅

If you don't use the object syntax, you don't need the clsx part. twMerge supports everything that clsx does except objects. I also believe you shouldn't use the object syntax when using Tailwind CSS classes.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@markomitranic
Comment options

@alianza
Comment options

@dcastil
Comment options

Answer selected by markomitranic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
3 participants