Fork me on GitHub
#cljsrn
<
2016-03-16
>
daveliepmann09:03:19

Holy cow, re-natal (and everything it's built on) is some great work.

escherize10:03:49

Hello! Are there any examples of using PickerIOS? I'm pretty sure I need a couple picker-items but not exactly sure how to wire this beast up

escherize10:03:05

here's the important part:

[picker {:style {:width 350 :height 100 :margin 100}
         :selected-value "Hi!"
         :key "heh wat"
         :on-value-change #(alert "???")}
 [picker-item {:key "ok"
               :value "Lemons!"
               :label "Hahah wat"}]]

escherize10:03:09

here's the whole file:

escherize10:03:33

it's a stock re-natal install, if that helps.

escherize10:03:53

ah hah, I found a bug

escherize10:03:21

(def picker-item (.-Item (.-PickerIOS js/React)))
=> change =>
(def picker-item (r/adapt-react-class (.-Item (.-PickerIOS js/React))))

daveliepmann10:03:07

@escherize: yeah the first snippet looks basically OK to me. My def is (def picker-item (r/adapt-react-class (.-PickerIOS.Item js/React)))

escherize10:03:23

I should probably just toss the picker's state into the app-db.

escherize10:03:21

and wire it up that way

pesterhazy10:03:05

we should start a wiki with those kinds of snippets, @escherize

daveliepmann11:03:34

@pesterhazy: agreed; would reduce unnecessary tinkering. One thought I had was a demo gallery-app using all (or most) RN components, like a fleshed-out version of mfikes' reagent-react-native: https://github.com/mfikes/reagent-react-native/blob/master/AwesomeProject/ClojureScript/awesome-project/src/awesome_project/core.cljs

escherize11:03:28

That would be totally awesome.

daveliepmann13:03:58

...for instance, nontrivial examples of ListViews would be helpful.