@lilactown Thank you!
Good day @lilactown! Can you explain this part? Don't get it but work neat!
I believe it’s because :values and :key are known at macro expansion time
The passed in props are only known at runtime and being turned from js-objects into cljs-objects via the bean function
yeah, there I’m using this library: https://github.com/mfikes/cljs-bean
to convert the JS object passed back from the react lib, I wrapped it in a bean
which will convert it to a CLJS map-like thing at the top level
I then also converted the :props
value to a bean, and finally the :style
value in the props
Glad I’ve internalized it
So ... will I always have to use cljs-bean when I want to pass props
to external libraries?
the library you’re using uses a very complex pattern here
you hand it a function that returns a component, and then it gives you the props to pass to your component
if you are using external library components that pass you data/props/etc. frequently, then you will need to handle that data appropriately
if you want to dynamically pass props to a component in helix, it must be a CLJS map-like thing.
so the complicated mess is boiled down to: 1. library gives you props data 2. turn props data into a CLJS map structure 3. pass it to your component when you run into patterns like that, then yes you’ll probably want to use cljs-bean
@lilactown Nice explanation, you are the best!
you’re welcome 🙂
btw, I have seen a lot of libraries called 'Helix', you did think in change the name?
hm, what other libraries?
https://github.com/Factual/clj-helix https://github.com/apache/helix https://github.com/NebulousCloud/helix https://github.com/MakotoKurauchi/helix
the two first are the most problematics
another day I wanted to share your Helix with my friends and shared the second repo XD
😅
those are all pretty distinct from what my library does
googling “helix clojure” has my lib as the first result
so I’m okay with a bit of collision