nosco / hx

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

Properly handle nil in classes vector #30

Closed orestis closed 5 years ago

orestis commented 5 years ago

I've noticed that having nil as a class value wasn't handled properly, so I'm adding a minimal card that showcases the issue.

I'm also attaching a possible fix, but I think I'm missing something because join-classes-js seems to do something different (joins the classes with a comma). Perhaps the vector? check is not needed at all?

BTW, hx is great and many thanks for putting it out there. The more I use it the more it makes sense as a minimal wrapper around react with some QoL affordances :)

lilactown commented 5 years ago

I appreciate you taking a look and am glad you're enjoying using it! Thanks for discovering this issue, too.

Your comment about join-classes-js got me wanting to take a deeper look at how this bit of code should work, which is why I haven't merged this PR yet. I hope to have time this weekend to go over it and maybe do a bit of cleanup so it's easier to work on in the future.

lilactown commented 5 years ago

https://github.com/Lokeh/hx/pull/40 also fixes this