Fork me on GitHub
#cljsrn
<
2017-05-05
>
harrybin03:05:55

@manu you can capture the back button on Android in re-natal in the android/core.cljs file and then have it execute any function, which when it returns true tells Android not to handle the back itself. In my example I use it with re-frame to always dispatch a navigation pop event (which does nothing when at the top of the stack)

levitanong07:05:06

@amorokh I’m back to trying out your om-navigate, and it seems all the components lose access to the reconciler, preventing one from using om/get-query and om/transact! within the components. Are you doing anything special to recover this functionality?

manu09:05:11

@harrybin i did it thanks!! 😄 actually I tried using BackHandler since seems BackAndroid is deprecated (https://facebook.github.io/react-native/docs/backandroid.html) but backHandler is not working.

amorokh10:05:27

@levitanong I am not sure what u mean by components losing access to the reconciler but I haven't implemented anything more than the playground example, except for some small IQuery stuff for some Components, haven't tried om/transact! at all

levitanong10:05:52

amorokh: (om/get-reconciler this) returning the reconciler is a prerequisite for om/transact!. Inside create-screen-proxy, calling (om/get-reconciler this) yields nil because transform-routes is converted to a javascript object via clj->js. This results in the screen proxy losing the reference to the reconciler.

amorokh11:05:03

Ok I see, I will take a look at this as soon as I can (I am quite new to all this so I will certainly learn somethibg new)

levitanong11:05:09

I think the solution will be to reestablish bindings: https://github.com/hugoduncan/navigator-repro/blob/master/src/navigator_repro/macros.clj#L3 However I’m not entirely sure where to put it. I’ve tried a few places but I’m new to this too, and you’re probably best equipped to figure this out. 😉

levitanong10:05:52

amorokh: (om/get-reconciler this) returning the reconciler is a prerequisite for om/transact!. Inside create-screen-proxy, calling (om/get-reconciler this) yields nil because transform-routes is converted to a javascript object via clj->js. This results in the screen proxy losing the reference to the reconciler.

levitanong11:05:09

I think the solution will be to reestablish bindings: https://github.com/hugoduncan/navigator-repro/blob/master/src/navigator_repro/macros.clj#L3 However I’m not entirely sure where to put it. I’ve tried a few places but I’m new to this too, and you’re probably best equipped to figure this out. 😉