Open coyotespike opened 7 years ago
Hey, not sure how far you got here, or if you're even looking at this anymore, but I had some time to work on this...
I made a fork of re-navigate so I could use the updated react-native v0.31 stuff. Updated fork is here: https://github.com/weltan/re-navigate
Tried to see if that fixed the animation syncing things, but no luck.
I'm going to keep looking at this, slash may ask around on the #cljsrn Slack channel. I also don't understand why the re-navigate example doesn't show how to switch complete scenes, rather than update the component, seems like that's the more common use-case.
Yes, I agree about the re-navigate example! Of course it's possible to swap out components/attributes of the same scene, but completely different scenes makes more intuitive sense to me.
Hopefully this weekend I'll start a sort of cookbook, just to collect demos of as many components as possible, and I'd like to include your navigation example or an adaptation of it. Whenever we figure out the animation syncing thing, that can go in too. :-)
That'd be sweet, let me know how it goes, and you can certainly use anything I've written!
Thanks for making this more substantive example of re-navigation, I'm finding it very helpful to learn and to teach.
I confirmed your result that ':nav/current' switches scenes before the animation happens.
I defined a new sub:
And used it like
As a result, when I click on the buttons, the animation happens, but it pages to the home page, where we already were.
Like the reagent cookbook, we will probably end up collecting components for instruction, and it would be nice to update via subscriptions instead of javascripty props. How can we get the animation in sync? I don't fully understand the cause of this behavior.
If I think of something I will post here.