Giter Site home page Giter Site logo

Comments (6)

cmeeren avatar cmeeren commented on July 19, 2024

Also, it would remove a potential conflict/confusion with the classes prop that is used for more or less every Material-UI component.

from feliz.

Zaid-Ajaj avatar Zaid-Ajaj commented on July 19, 2024

I liked the fact that classes is plural so that it takes a list of things, whereas className is supposed to take a single class(name). As for classWhen: the name implies the use of conditionals and will probably replace classList in the stable release.

This is my rationale for the choices, I will keep this (and the other issues) open for suggestions until the stable release

from feliz.

cmeeren avatar cmeeren commented on July 19, 2024

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 className (which AFAIK is the canonical React name), then all users immediately see the various overloads (ways to add classes) when looking at the Intellisense.

Happiness +1 :)

from feliz.

Zaid-Ajaj avatar Zaid-Ajaj commented on July 19, 2024

For readability: use classes, className and classWhen
For consistency & usability: use overloaded classes
For conformity (with React): use overloaded className

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 😄

from feliz.

cmeeren avatar cmeeren commented on July 19, 2024

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 classes, though IMHO it's better to follow established and google-able names, so I would go with className, which immediately indicates to users that it corresponds to the same React prop. Consistency, usability, and conformity. Yay!

Personally I don't find classes/className/classWhen more readable. classWhen in particular sounds very weird in my ears.

from feliz.

cmeeren avatar cmeeren commented on July 19, 2024

Also I really really appreciate your feedback, helps a lot to moving forward with this library 😄

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. :)

from feliz.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.