lukeed/clsx

add example how to use with babel

FDiskas opened this issue · 1 comments

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

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

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

There is also 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~!