Skip to content
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

(Typescript) Expose classList type #2378

Open
marvin-j97 opened this issue Dec 10, 2024 · 1 comment
Open

(Typescript) Expose classList type #2378

marvin-j97 opened this issue Dec 10, 2024 · 1 comment

Comments

@marvin-j97
Copy link
Contributor

Currently exposing classList as a prop requires a custom type. It would be better to create a "ClassList" type definition, use that everywhere and expose it. PR following shortly.

@titoBouzout
Copy link
Contributor

titoBouzout commented Dec 16, 2024

We are in the process of meditating if classList should be deprecated, replaced by something else (such a super powered class[class behaving as classlist]/clsx equivalent) or just plainly suggest to use clsx instead, or maybe even leave it as is.

It has issues like defining both class and classList overwrites each other in un/predictable ways when stuff is dynamic. Specially when used in spreads(spreading before or after setting class as attribute?), when effects run out of the expected order(there are no expectation on the order effects run), and it has issues with SSR too.

I am probably missing some other situation. I meant to investigate this. While I somewhat understand the issue, I am not confident enough about its problems (it only happens in some circumstances and most of the time is not an issue or a big deal), and I am also not authoritative enough to decide over its future.

btw, the typings are in https://github.com/ryansolid/dom-expressions/blob/main/packages/dom-expressions/src/jsx.d.ts

I mentioned all of the above because we do not seem to be sure about its future, so you can consider

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants