lukeed/clsxPublic

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

add example how to use with babel

FD

There is a cool babel plugin ads ability to skip importing on each component this `clsx` library.

https://github.com/giuseppeg/babel-plugin-classnames

  1. LU

    That project is unrelated & is responsible for its own documentation (which it provides).

    There is also [`babel-plugin-optimize-clsx`](https://www.npmjs.com/package/babel-plugin-optimize-clsx) btw, which has a different purpose but can work very well if you're buying into Babel ecosystem.

    These two plugins don't work with one another, so if given a choice, I would prefer only providing _a link_ to `babel-plugin-optimize-clsx` as it actually provides a benefit for your application's output. If you want to add a PR, you may add a link to this underneath `obj-str` in the Related section.

    Thanks~!

  2. lukeedclosed5 years ago on GitHub