Closed wilkerlucio closed 4 years ago
Ok, I just figured that on native components we can't send :style
as js-obj.
This leads to a confusing situation in React Native, because some of the components there are native (string-based) and others are not (for example, View
is a native component, but Button
is not), and then figuring when one style should be used over the other gets confusing.
Maybe Helix could always accept the #js
version as well, so the client could wrap those consistently?
Another option could be some validation at dev mode to let the user know that it was supposed to use a clojure or a js map in each case.
it can maybe check (or (sequential? x) (map? x))
instead, those operations don't seem to throw errors for js objects
As it stands I end up having to do {:style (bean style)
somewhat often, when a style is passed to me either from a library or the result of Helix's own conversion.
Thanks for reporting. @tekacs your use case is very motivating. I'll release 0.0.12 with a fix soon!
Hello,
I found a bug in the
$
with native components.Reproduce example:
This gets an error of
Error: [object Object] is not ISeqable
I did a little dig, the problem seems to be in this line here: https://github.com/Lokeh/helix/blob/37aca5e65704da96915a4435e6825da4e4de3af7/src/helix/impl/props.cljc#L57
At my example, this ends up calling
seq
with a JS object, which triggers the error.