Fork me on GitHub
#cljsrn
<
2016-10-12
>
vikeri07:10:36

@pvinis: I have this: (`camelify-map-keys` is from reagent.impl.component)

(def alert (fn [{:keys [title message buttons]}]
             (.alert (.-Alert react-native)
                     (str title)
                     message (clj->js (mapv camelify-map-keys buttons)))))
The input then looks like this:
{:text    "Text"
 :message "Message"
 :buttons [{:text  "Cancel"
            :style "cancel"}
           {:text "OK"
            :fn/on-press
                  #(dispatch [:alert/ok])}]}

pvinis08:10:11

@misha great. i completely forgot about the multiple arity functions in clj. @vikeri i was about to ask that. how can i write on-press and not break js stuff. great!

tianshu17:10:44

@pesterhazy since some people already have the experience with build android release with boot-react-native, the steps should be added in the document.