Add plugin for classNames for react #6999
oviirup
started this conversation in
Plugin request / idea
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Background
Tools like classnames, clsx are really useful to add support for dynamic classNames in React. You have to import it to use it in your project, as usual. But this babel plugin adds native support classnames, and you don't have to import it again and again.
Problem to solve
As of the recent release of NextJS, it uses SWC compiler by default. We can go back to Babel but some of its features can only be accessed through SWC (like next/font). Using Babel breaks the code.
Sadly I am not a Rust developer, I don't know how to build a custom plugin for that.
It would be great if there was some plugin just like Babel plugin for SWC to add native support for classNames.
Beta Was this translation helpful? Give feedback.
All reactions