-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make classList and classes overloads of className #14
Comments
Also, it would remove a potential conflict/confusion with the |
I liked the fact that classes is plural so that it takes a list of things, whereas This is my rationale for the choices, I will keep this (and the other issues) open for suggestions until the stable release |
Yep, I just figured that since you do overloads anyway for improved usability, then using different names for what is essentially the same thing (a list of classes) was confusing to end users. I guess my strongest point is this: It's not self-documenting that there are multiple ways to add classes; you have to read the docs to get it. Whereas if everything that adds classes are just overloads of Happiness +1 :) |
For readability: use I am sure there is a way to strike a perfect balance but it is not an obvious choice to make here Also I really really appreciate your feedback, helps a lot to moving forward with this library 😄 |
Yep, there are always tradeoffs... AFAIK the point of Feliz is discoverability/usability (it's certainly what brought me here), so I would definitely go with overloads in this case. I would be comfortable with overloaded Personally I don't find |
Happy to share my opinions! Note that they are in general strong opinions, weakly held. I can always change my mind in light of new realizations, information and compelling arguments. :) |
AFAIK
className
is a space-separated string of class names to apply to the component/element. Why not makeclassList
(andclassWhen
) andclasses
overloads ofclassName
? That would improve discoverability, remove confusing extra names for what is essentially the same property, and be more in line with the goal of this project as I understand it.The text was updated successfully, but these errors were encountered: