Closed jasecoop closed 8 years ago
The underlying Navigator API is imperative and stateful so it's good to go into this with the understanding that the component hierarchy here is not 100% reactive. Note the initialRoute prop: it is named that way since it's the route used for only the first render() pass. After that the route stack is controlled solely via imperative push/pop methods.
I don't fully understand your problem but could the issue be that you're invoking this.props.onLogin() instead of passing in the function?
I don't fully understand your problem but could the issue be that you're invoking this.props.onLogin() instead of passing in the function?
@ide that very well might be the case, how would I pass the function instead of invoking it?
Change:
Router.getStartRoute(this.props.handleLogin())
to
Router.getStartRoute(this.props.handleLogin)
?
When using React I tend to pass functions as props into the children from their parent where they're called.
When I do this through ExNavigator, the function is undefined. E.g.
How do I call a function from a parent view with ExNavigator? I thought this was an important part of React, with state being kept in the parent as much as possible.