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

mode prop for Screen #232

Closed
nihgwu opened this issue Feb 8, 2017 · 8 comments
Closed

mode prop for Screen #232

nihgwu opened this issue Feb 8, 2017 · 8 comments

Comments

@nihgwu
Copy link

nihgwu commented Feb 8, 2017

Right now mode is only available for StackNavigatorConfigand only accepts a string, so all the Screens in it are with the same transition mode, if we want different modes between views, we need to define different Navigators and nest them, which makes things complex, so I have the following propose:

  1. add mode to Screen Navigation Options
  2. make mode accepts a function

Any ideas? I'd love to send a PR to implement

@satya164
Copy link
Member

satya164 commented Feb 8, 2017

Feel free to send a PR moving mode to navigationOptions and deprecate in StackNavigatorConfig

We also need to deprecate visible prop. Make sure to post a video of what happens when one two consecutive screens have different modes.

make mode accepts a function

Why do you need it to be a function?

@nihgwu
Copy link
Author

nihgwu commented Feb 8, 2017

If mode could be a function, then we can keep mode in StackNavigatorConfig, and config the mode here according the router state or params

But I think the first option is more sensible

@ericvicenti
Copy link
Contributor

I haven't done this in the past because it causes some visual issue in comparison to navigator nesting.

Here's an example. Say I have a stack with a modal on top of a card. When the modal animates back to he card, the modal looks fine but the card still has the card movement, which means it is slightly offscreen to the left, and as the modal dismisses it moves back to the center of screen.

The issue is fixable, but we need to be careful as we make big changes to CardStack, which is arguably the most complicated part of the codebase.

@nihgwu
Copy link
Author

nihgwu commented Mar 16, 2017

I have a workaround for this https://github.com/nihgwu/react-native-dva-starter#advance, but this will introduce nested navigator issues

@j-mendez
Copy link

Is this actively being worked on?

@ragnorc
Copy link

ragnorc commented Apr 10, 2017

#972

@ericvicenti
Copy link
Contributor

For now, you can use this hack to easily support both types of screen inside of one navigator:

#707 (comment)

It would be a huge change to add this feature as a navigation option, and we are trying to stabilize for v1. @nihgwu, if you have an idea for a simple implementation that doesn't cause lots of regressions, feel free to open a new issue and tag me.

@18234068849
Copy link

image

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

7 participants