Comments (6)
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.
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.
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.
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.
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.
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)
- Add jsx string template support to default template and to docs? HOT 1
- Feliz.Markdown plug-in support HOT 2
- Issue version 3.10.0 when using another Router component in the inner component
- IReactProperty Question HOT 1
- Q: interesting
- add vitest to template
- useElmish vs useReducer HOT 4
- Feedback on missing docs for newcomers HOT 1
- ReactComponentAttribute for props list HOT 2
- Q: Documentation on breaking changes in 2.6? [WAS Updating Feliz.UseListener to Feliz 2.6.0] HOT 4
- CSS overflow-anchor property HOT 1
- Error with Feliz 2.7 HOT 2
- Making UseElmish's dispatch function stable
- Feliz.Markdown escapeHtml doesn't seem to work HOT 1
- UseElmish: Failed to resolve import "use-sync-external-store/shim" HOT 3
- `react-markdown` removes the `escapeHtml` property HOT 1
- Clarification and Potential Improvement on PR #480 useEffectOnce behavior HOT 5
- Expanding Feliz.Rechart HOT 3
- Component created with a forwardRef that has generic type parameters loses state HOT 2
- "Directory import use-sync-external-store\shim is not supported" in UseElmish.fs.js HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from feliz.