nosco / hx

A simple, easy to use library for React development in ClojureScript.
MIT License
247 stars 16 forks source link

Support for class shortcut in hiccup: `:div.foo`? #29

Closed orestis closed 5 years ago

orestis commented 5 years ago

Hi, I've noticed that a very common reagent pattern, i.e. :div.foo to add the foo class to :div isn't supported in hx. Is this by design?

lilactown commented 5 years ago

It's not a hill I would die on, but I purposely didn't add it because I never use it.

I'm not completely opposed to adding it, but there are downsides: complecting tag and props complicates threading props down the component tree when you want to override class / id.

It might be useful to help people move from reagent to hx. Is it something you find important?

orestis commented 5 years ago

To be honest, it just took me surprise. I agree that it’s complecting some things and makes the library more magic than it needs to. I’ll get back to you after a few more days of using the library and see if it’s something I really miss or just force of habit.

It's not a hill I would die on, but I purposely didn't add it because I never use it.

I'm not completely opposed to adding it, but there are downsides: complecting tag and props complicates threading props down the component tree when you want to override class / id.

It might be useful to help people move from reagent to hx. Is it something you find important?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

pepe commented 5 years ago

I would leave it as it is. This specific class and id make my code more understandable.

I just moved https://github.com/laststar/showrum (everything but the README :) ) from run to hx in and this bit me more than once, but still, I like it more this way.

lilactown commented 5 years ago

Closing this for now.