Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What's the difference with classcat #8

Closed
vladshcherbin opened this issue Feb 23, 2019 · 2 comments
Closed

What's the difference with classcat #8

vladshcherbin opened this issue Feb 23, 2019 · 2 comments

Comments

@vladshcherbin
Copy link

Hey,

What's the difference with classcat package? It was also released as a faster/smaller/esm ready version of classnames a year ago.

Why another package with same purpose? It even has a benchmark where clsx seems to be many times slower. 🤔

Thanks

@lukeed
Copy link
Owner

lukeed commented Feb 23, 2019

Hey, thanks!

Classcat only works with a single parameter, which is an array of your values. This means it is 100% not compatible with classnames usage.

Clsx is a complete drop-in replacement for classnames. And if you look at my benchmarks (which are classnames' benchmarks) you'll see that Array-values are the worst case scenario for clsx. So what you're seeing is my worst case pinned against classcat's only case.

Hope that clears things up :)

@lukeed lukeed closed this as completed Feb 23, 2019
@vladshcherbin
Copy link
Author

@lukeed thanks for explanation :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants