This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-02-01
Channels
- # aleph (71)
- # aws (1)
- # bangalore-clj (4)
- # beginners (36)
- # boot (153)
- # cider (23)
- # clara (9)
- # cljs-dev (67)
- # cljsjs (2)
- # cljsrn (22)
- # clojure (348)
- # clojure-argentina (4)
- # clojure-austin (12)
- # clojure-berlin (9)
- # clojure-dusseldorf (6)
- # clojure-france (4)
- # clojure-italy (4)
- # clojure-russia (358)
- # clojure-spain (2)
- # clojure-spec (28)
- # clojure-uk (109)
- # clojurescript (130)
- # core-typed (1)
- # cursive (35)
- # datascript (6)
- # datomic (18)
- # emacs (12)
- # hoplon (4)
- # klipse (64)
- # lein-figwheel (13)
- # leiningen (3)
- # luminus (4)
- # lumo (51)
- # mount (22)
- # off-topic (83)
- # om (22)
- # om-next (8)
- # onyx (3)
- # pedestal (8)
- # perun (6)
- # portland-or (2)
- # re-frame (50)
- # ring (8)
- # ring-swagger (5)
- # untangled (10)
- # yada (9)
@pesterhazy finally got the navigator working, my mistake was that I didn't call them as keyword, and the the #js conversion also was required
however, there's an ugly delay that crumbles screen from previous scene to the next, not sure if it's genymotion thing or react's navigator problem
Try using a non debug build
In my experience it makes a huge performance difference on Android
this is the working snippet btw:
my_scene.cljs
:
(defn my-scene [props]
[view
[text "Current Scene: " (:title props)]
[touchable-highlight {:on-press (:on-forward props)}
[text "Tap me to load the next scene"]]
[touchable-highlight {:on-press (:on-back props)}
[text "Tap me to go back"]]])
core.cljs
:
(defn app-root []
[navigator {:initial-route {:title "My Initial Scene"
:index 0}
:render-scene (fn [route, nav]
(r/as-element [ms/my-scene {:title (.-title route)
:on-forward (fn []
(.push nav #js {:title (str "Scene " (.-index route))
:index (inc (.-index route))}))
:on-back (fn []
(.pop nav))}]))}])
Nice, looks good
In my code I store the navigator in an atom so I can trigger nav events from any function
It's not pretty but it works pretty well
thanks @pesterhazy, will try that sometime in the future, I'm also tempted to improvise but I tried to avoid it so the code can at least reflect 1:1 from the sample
Yeah I agree
For the about that's much better
For the snippet
and regarding putting it in the wiki, I think I'm still not capable of explaining it well, so I'm not sure, maybe you'll be better putting it there if you have the time 😄
and thanks again @pesterhazy, now I'm thinking if I should continue to learn re-frame or go to back-end for a while with clojure :thinking_face:
Re-frame is definitely worth learning
On the navigation theme, I just got a VERY quick and dirty version of the new React Navigation library going. I now have tabs with a nested stack navigation. But I couldn’t read the tab routing from re-frame without getting an annoying gitter, so did it very hackily for now, the stack navigation is fully connected to re-frame though, and works well. The cljs code is very ugly, but I have a deadline so no time to clean it up. https://github.com/vikeri/re-navigate
nice!
afaiu, this thing knows how to use https://github.com/bodymovin/bodymovin jsons