Fork me on GitHub

I find the wiki a bit too fast moving and looking for something that explains an app step by step


@qqq you might want to look at #untangled and the community resources at the bottom of the wiki:


@danielstockton : oh wow, untangled looks amazing


Hello all, a little question with on React Native (ios) using re-natal I am following the documentation on Navigator and I try to translate it to cljs. This code is working for this example =>

(defui MyScene
  (render [this]
          (let [{:keys [title onForward onBack]} (om/props this)]
            (js/console.log (om/props this))
            (view nil
                  (text {:style {:fontSize 20}} (str "Scene name is : " title))

                  (touchable-highlight {:onPress onForward}
                                       (text nil "Tap me to load the next scene "))

                  (touchable-highlight {:onPress onBack}
                                       (text nil "Tap me to Go back"))))))

(defonce my-scene (om/factory MyScene))

(def navigator (partial create-element (.-Navigator ReactNative)))

(defui AppRoot
  static om/IQuery
  (query [this]
  (render [this]
          (let [{:keys [app/msg]} (om/props this)]
             {:initialRoute {:title "My Initial Scene héhé"
                             :index 0}
              :renderScene (fn [route, navigator]
                             (my-scene {:title (.-title route)
                                        :onForward (fn []
                                                     (let [nextIndex (inc (.-index route))]
                                                       (.push navigator {:title (str "Scene " nextIndex)
                                                                         :index nextIndex})))
                                        :onBack (fn []
                                                  (if (pos? (.-index route))
                                                    (.pop navigator)))}))}))))
I am lost in making props required as in the example =>
MyScene.propTypes = {
  title: PropTypes.string.isRequired,
  onForward: PropTypes.func.isRequired,
  onBack: PropTypes.func.isRequired,
any ideas on how to do it ?