Fork me on GitHub

Now, I’m using, and almost got it to work following exactly the same steps as we did above for the TableView. I have an issue with translating the colors from cljs to js :

(lineargradient {:colors ["#4C669F" "#3B5998" "#192F6A"]}
                                      (text nil "Login" ))
will fail with JSON value ‘#4C669F’ of type NSString cannot be converted to NSNumber. Here what I see in the repl when trying to convert the data structure :
(clj->js ["#4C669F" "#3B5998" "#192F6A"])
=> #js ["#4C669F" "#3B5998" "#192F6A »]

. What am I doing wrong ?


Note that

(lineargradient {:colors [0x4C669F 0x3B5998 0x192F6A]}
                                      (text nil "Login"))
doesn’t show up the colors but at least doens’t throw exceptions...


(clj->js should it be before colors?


I mean probably you should convert the whole style


(lineargradient (clj->js {:colors ["#4C669F" "#3B5998" "#192F6A”]}) (text nil "Login" ))


I forgot to say I declared the following earlier in the namespace:

(def LinearGradient (js/require "LinearGradient"))
(defn lineargradient [opts & children]
    (apply js/React.createElement
           LinearGradient (clj->js opts) children))


So in theory

(lineargradient {:colors ["#4C669F" "#3B5998" "#192F6A"]}
                                      (text nil "Login" ))
is supposed to work as is.


well, then the only way is to check the compiled code, set a break on createElement and see what is inside. Components expect just a string, so CLJS shouldn’t break it


Well, I’m investigating how to do that. I’ve stepped into the Chrome debugger, but where is the generated code (something like main.js when doing regular Om) ? I see index.ios.js and the content of index.ios.bundle?platform=ios&dev=true but neither contains my core namespace code (generated to js).


sry, I’m not using natal or ambly, cannot tell


good to know. One thing that I learned with RN - always be on a edge, 0.12 is quite old