Fork me on GitHub
#cljsrn
<
2018-05-31
>
hoopes00:05:59

Has anyone used https://github.com/seantempesta/cljs-react-navigation in an app with re-frame? The docs say you can dispatch navigation events, and there’s an example, but I’m having trouble following the example - it still uses navigate directly, and while there are events that reset the routing state, I can’t see exactly how they interact. If anyone has any examples of this, I’d be much obliged. (Are there newer/different RN navigation libs?)

Oliver George00:05:35

I'm not familiar with it but the code is clean. Seems like a high quality library.

hoopes00:05:54

for sure - i'm just slow on the uptake

Oliver George00:05:06

Lots of things to cut yourself on in the cljsrn space

hoopes00:05:07

thanks for that link! meant to bookmark that before...

Oliver George00:05:33

I'll try and keep polishing it / fleshing it out over the next few weeks.

Oliver George00:05:38

Feedback welcome

vikeri12:05:15

@hoopes We’re using it successfully but with an old version of react-navigation. I don’t think it works for newer versions of react-navigation.

hoopes12:05:10

Are you using the navigate function passed in with props, or dispatching an event to change route (from anywhere)? Thanks for the reply!

vikeri13:06:07

Sorry for late response, we use the built in dispatch events through re-frame

hoopes22:06:28

Hey, thanks for the response (and sorry for my even later response) - can you share what's in your event handlers? I'd love to be able to just dispatch a routing change from anywhere, but I'm not sure what to call to make it happen. Are you also storing your routing state in the app-db? Thanks very much!

hoopes22:06:37

@U0AU4CPTN... also, sorry for the @-notification, i hadn't seen this, and wasn't sure if you'd get notified of my response. If that's super annoying bad slack etiquette, I apologize!

vikeri08:06:22

We keep the navigation state as a js object in the re-frame state. Ugly, but works

vikeri08:06:36

I’m not sure this is the best solution for navigation going forward though

hoopes13:06:09

#hero - thanks man, i greatly appreciate this. i'm just learning cljs->rn, so maybe someday there will be something better, but by then, i can throw away what i'm learning on right now. thanks again!