Open kylecordes opened 2 years ago
for JSX they usually want you to import classnames that does this https://www.npmjs.com/package/classnames
Yeah, this suggestion effectively entails implementing what the classnames
package does into Mitosis. I think, for now, folks who like those ergonomics can import classnames
manually and use it, and we can explore baking it in the future once the fundamentals of the Mitosis core are more stable.
Feature request...
Angular has
[class:foo]="bar"
Svelte has
class:foo={bar}
Solid isn't too far behind, with:
classList={{ active: state.active, editing: state.currentId === row.id }}
Mitosis has a CSS-in-JS construct, but conditional classes are currently just the basic JSX roughness, for example this bit from the TODO example. This syntax scales poorly to a longer list with multiple conditional classes.
How about a better conditional class syntax? Ideally minimalist like Angular or Svelte, but even a Solid-like mechanism is the box would be great.