Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should configureScene be handled by the route instead of the navigator? #12

Open
despairblue opened this issue Oct 27, 2015 · 3 comments

Comments

@despairblue
Copy link
Contributor

I have an app with a tabbar, three tabs, one global navigator and one navigator in each tab. All views pushed onto the global navigator should float from the bottom (they hide the tabbar). All views pushed onto one of the other navigators should float from the right (they don't hide the tabbar, it's still possible to navigate to other tabs without popping the views).

Some views can be pushed to any navigator (like a log-in-view). Now I either need to make two different route factories for the login view or pass in props into the route factory to create a route with the specific scene configuration.

Either way the views that push the log-in-view need to know where they are in the view hierarchy to either choose the correct route factory or to pass the correct scene configuration into the route factory. That seems wrong, as it goes against composition. 😕

Shouldn't only the place of the navigator in the view hierarchy decide about how the next view is shown?

@ide
Copy link
Member

ide commented Oct 27, 2015

Makes sense. We probably want both the navigator and the route to decide what the transition should look like. For example, in your top-level navigator sometimes you may want to float a scene from the top instead of the bottom, depending on the scene.

Would this API work for you?

<ExNavigator
  defaultSceneConfig={FloatFromBottom}
/>

@despairblue
Copy link
Contributor Author

lgtm 👍

@cancan101
Copy link
Contributor

It seems what is there is just a bug? RN shows on the Navigator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants