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

No way to know if Transitions to same Scene class is backwards #151

Open
gumil opened this issue Sep 18, 2019 · 3 comments
Open

No way to know if Transitions to same Scene class is backwards #151

gumil opened this issue Sep 18, 2019 · 3 comments
Labels
type:documentation Documentation is needed

Comments

@gumil
Copy link

gumil commented Sep 18, 2019

Is your feature request related to a problem? Please describe.
For example:
Scene1 pushes to Scene1
They are the same scenes but can have different data. So during transition there's no way to identify if the scene is going back one screen since it is still the same scene class.

An example of a transition that affects this is sliding from left to right. When going back it should be from right to left.

Describe the solution you'd like
Have a way in transition factory to know if the transition happening is going back or forward.

Describe alternatives you've considered
Is it also possible for a more granular transition mechanism where it can be specified on specific navigators?

This is an edge case it seems as I am trying this out in a sample application with unrealistic backstack and screens.

@nhaarman
Copy link
Owner

There is TransitionData which contains an isBackwards property, and is passed to the SceneTransitionFactory.

For the StackNavigator this data is properly set when pushing and popping and is used for the default transitions accordingly.

Is this what you're looking for?

@gumil
Copy link
Author

gumil commented Sep 19, 2019

Yes this is it. Thanks for the help. This feature is kinda hard to find. It was not in the documentation and I assumed acorn creates it using only the DSL

@nhaarman
Copy link
Owner

Cool! I'll make sure it gets added to the docs 👍

@nhaarman nhaarman added the type:documentation Documentation is needed label Sep 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:documentation Documentation is needed
Projects
None yet
Development

No branches or pull requests

2 participants