This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # beginners (27)
- # boot (49)
- # cider (51)
- # cljs-dev (29)
- # cljsjs (1)
- # cljsrn (19)
- # clojure (59)
- # clojure-austin (2)
- # clojure-belgium (19)
- # clojure-china (1)
- # clojure-dev (14)
- # clojure-dusseldorf (7)
- # clojure-russia (8)
- # clojure-spec (115)
- # clojure-uk (45)
- # clojurescript (118)
- # css (6)
- # cursive (8)
- # datascript (20)
- # datomic (32)
- # emacs (5)
- # events (2)
- # flambo (21)
- # hoplon (58)
- # incanter (8)
- # jobs-rus (1)
- # jobs_rus (1)
- # off-topic (3)
- # om (22)
- # om-next (9)
- # onyx (5)
- # other-languages (79)
- # re-frame (126)
- # reagent (6)
- # ring (7)
- # specter (1)
- # untangled (119)
- # yada (38)
@madvas: really neat with a full project up on github! A coupe of questions, why did you put the navigation state in a separate atom and not in the re-frame logic?
@vikeri: good question. Since
react-native-navigation is really native navigation, that also means u don’t have any access to it’s state. So I tried to mimic its state in cljs. I bundled it into separate state atom, so whole logic of navigation can be in one file, cuz I might create library from it in future, so it can work more out of the box for others 🙂
@madvas: Alright, I see that you don’t want to couple it to re-frame if you want to make it a library, the downside is that all the re-frame goodness like debug etc wont be present.
@vikeri: that’s true, but you can read navigation state at any time for debugging by simply
nav/get-nav-state . but I might give it some more hammock time tho 😉
@madvas: Your solution work only on ios, isn’t it?
@savelichalex: yes, but support for android from
react-native-navigation is “Coming soon” according to their page 🙂
@madvas: ok, another question) If your nav state is another atom then re-frame state how you do dispatch? I can’t find it) You do 2 dispatches from view, one for navigation and one for re-frame state?
@vikeri: What are you think about it?
I’m watching in both solution, with experimental navigation and what @madvas do
Trying to choose one)
@savelichalex, @madvas: Personally I think that following what facebook are focusing on internally, NavigationExperimental, is the way to go. Especially since the abstract model fits very well with re-frame. But it is still very Experimental, so I’m waiting for the API to settle down a bit before I try to make something more around it.
It maybe better to set scene in re-frame state and add sub on it?
NavigationExperimental also fits well with Redux which seems to be quite popular in the React World. Hopefully we’ll be able to piggyback on tooling and stuff that comes up around NavigationExperimental.
@savelichalex: Let me explain a bit. Nav state atom isn’t anyhow related to re-frame, it lives on its own. It’s main purpose is, when you do hot reload with figwheel, Navigation can reassemble itself back to original state, so you don’t have to navigate again. This is normal for regular react navigations, not for native one. when you run
start-single-screen-app! you can pass
persist-state? it means if it’ll reconstruct old nav state or starts from homepage.
@savelichalex: I can tell you straight away
NavigationExperimental plays much better with re-frame/Om than
react-native-navigation. If you really want native navigation, with lot of sugar around
react-native-navigation is usable.
Looks like Android support is crucial factor for me right now) Thanks guys!
Honestly both solutions looks good) @madvas great work around react-native-navigation!
@savelichalex: thanks, if I find time to make it into library I’ll let you know 😉
guys, I've updated luno-react-native (https://github.com/alwx/luno-react-native), it now uses the latest versions of re-natal and react native and works perfectly again. thanks for creating issues and waiting for so long for my fixes 🙂