lukeed/clsxPublic

A tiny (239B) utility for constructing `className` strings conditionally.

Add comparison with Classnames utility

GH

ghost opened ·

https://github.com/JedWatson/classnames

There's a well established library which seems to do what this library does, is older and has more installations. To the casual observer it's not clear what's different between this library and that library. I've already seen people adding `clsx` to apps when `classnames` is already present probably because they (1) didn't know the prior exists and (2) like the terse syntax.

Please update your `README` to provide a comparison of the two tools and link to the other one and send them an issue to backlink to you. Otherwise we're looking at another `husky` situation down the line due to devs not realizing what this library is and isn't. Thanks.

  1. GH
    Author

    Here's one thing this library appears to have going for it:

    <img width="741" alt="Screen Shot 2021-04-21 at 8 42 26 PM" src="https://user-images.githubusercontent.com/65664227/115555485-257a1b00-a2e2-11eb-8aa3-1fde32ebbb51.png">

    When I tried a `yarn add --dev @types/classnames` the above issue persisted with the other library, causing me to have to throw out a `declare module 'classnames';` in a `d.ts` file in my app.

  2. LU

    > Also serves as a faster & smaller drop-in replacement for the classnames module.

    ^second sentence of the readme. That's all there is to know. Sure, included TypeScript definitions is a bonus, but isn't a reason to pick one over the other.

  3. lukeedclosed5 years ago on GitHub

  4. GH
    Author

    LMAO. Sorry dude totally missed that. >_^