lukeed/clsx

Public

What's the difference with classcat

VL

Hey,

What's the difference with [classcat](https://github.com/jorgebucaran/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

  1. LU

    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 :)

  2. lukeedclosed7 years ago on GitHub

  3. VL
    Author

    @lukeed thanks for explanation :)

  4. lukeedmentioned7 years ago on GitHub

  5. lukeedsubscribed7 years ago on GitHub