react-router-native icon indicating copy to clipboard operation
react-router-native copied to clipboard

Support react-router-relay via applyRouterMiddleware.

Open joonhocho opened this issue 8 years ago • 11 comments

@jmurzy, I finally got it working with react-router-relay. Please take a look and let me know what you think.

joonhocho avatar Jun 18 '16 02:06 joonhocho

Related https://github.com/jmurzy/react-router-native/issues/21.

joonhocho avatar Jun 18 '16 02:06 joonhocho

Thanks. At first sight it looks good. Do you have an example repo with react-router-relay I can use to run a few tests?

I'm currently working on #17 which will require refactoring a few things internally. Once I land a fix for that, this will be much easier to merge. Please bare with me as I catch up on my backlog.

🍺

jmurzy avatar Jun 18 '16 09:06 jmurzy

I will definitely add examples tomorrow.

joonhocho avatar Jun 18 '16 09:06 joonhocho

@jmurzy, Just created todo example with relay: https://github.com/joonhocho/react-native-router-relay-todo

joonhocho avatar Jun 19 '16 09:06 joonhocho

Awesome! Thanks.

🍺

jmurzy avatar Jun 20 '16 08:06 jmurzy

@jmurzy, There are currently few bugs I can spot with the todo app. First, relay initially fetches data for /complete and /any. Not sure, why it fetches /complete. Second, when you navigate to either complete tab, you will see two list all and complete on the screen. The same also happens for active tab.

joonhocho avatar Jun 20 '16 18:06 joonhocho

I've been looking into why it was rendering two lists after switching tabs, and I've found that it's because I am using Route as a parent route instead of StackRoute or TabsRoute.

RouteView does not supply configureTransition and applyAnimation to NavigationAnimatedView unlike StackRouteView or TabsRouteView.

As result, NavigationAnimatedView._onProgressChange does not get called which is responsible for removing stale scenes.

Also, Relay initially fetching /complete and /any turned out to be not a bug. /complete is loaded by TodoListFooter.

I've noticed that NavigationAnimatedView is being killed. Will it fix the above RouteView issue of not having any transition animation?

joonhocho avatar Jun 22 '16 10:06 joonhocho

More investigation on the bug. Not having the applyAnimation on RouteView was not the cause of the issue. The bug was caused by NavigationAnimatedView.componentDidUpdate. Removing the if statement fixed it.

joonhocho avatar Jun 23 '16 03:06 joonhocho

https://github.com/facebook/react-native/issues/7422 may be related.

joonhocho avatar Jun 23 '16 03:06 joonhocho

Hopefully new NavigationTransitioner fixes the issue.

joonhocho avatar Jun 23 '16 03:06 joonhocho

Yeah. Unfortunately though, patches that address that specific issue, facebook/react-native@c57bac4767fe4301ff4515b073d26245c6905610 and facebook/react-native@b4d15d3c5ac4542931e0f3d1b93b42109e523550, did not make it into 0.29-rc. I'm trying to get those cherry picked into 0.29, facebook/react-native#8333.

#17 and #3 are also related.

jmurzy avatar Jun 23 '16 04:06 jmurzy