nosco / hx

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

hx/f exceptions handlint #53

Closed gavlooth closed 5 years ago

gavlooth commented 5 years ago

when passing a nil value map {nil nil} (eg, when using select-keys with and the props have not been populated) with hx/f a doesn't support namespaces error occurs

gavlooth commented 5 years ago

Also i find the same problem on other instances, when i pash string props.

lilactown commented 5 years ago

Can you explain a bit more how you’re ending up passing {nil nil} to a component? I’m not sure I understand the select-keys example you mention.

FWIW, passing {:foo nil} should work just fine, but I currently believe passing anything other than a keyword as a key will error.

gavlooth commented 5 years ago

Seems that select-keys returns a {nil nil} map when no keys are found but i am not sure, i remember correctly. However what you say make sence because i also have problems with string keys.

lilactown commented 5 years ago

In my REPL (latest CLJS):

cljs.user> (select-keys {} [:foo :bar])
{}

I can perhaps add some support for string keys. Is there a reason you're using them specifically?