react-router-native
react-router-native copied to clipboard
Support react-router-relay via applyRouterMiddleware.
@jmurzy, I finally got it working with react-router-relay. Please take a look and let me know what you think.
Related https://github.com/jmurzy/react-router-native/issues/21.
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.
🍺
I will definitely add examples tomorrow.
@jmurzy, Just created todo example with relay: https://github.com/joonhocho/react-native-router-relay-todo
Awesome! Thanks.
🍺
@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.
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?
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.
https://github.com/facebook/react-native/issues/7422 may be related.
Hopefully new NavigationTransitioner fixes the issue.
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.