-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Custom animations for scenes (disabling transition animation) #2042
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
Comments
Very good question. Probably we will implement some workaround soon if ReactNavigation doesn't allow it. What is your use case? You could try to use 'tabs' with tabbar hidden to avoid animation or you could try type 'reset' (check Example/Register UI, or it doesn't allow animation too?) Check related issue: |
@aksonov Thanks for the link, I will check it out. My use case is that my app has a static background image that doesn't change or move when you navigate between screens. In V3 this was achieved by wrapping the Router component with an Image and setting a transpararent background for every scene. Because the default visual effect for transition is to slide in the new scene while fading out the old one, having a duration means that we can see both scenes durings parts of the transition. In the past I have tried using 'reset' as an alternative and it mostly worked, but I had to manually implement every scene's back behaviour, this can get out of hand very quickly. |
@ywongweb Maybe you could implement own custom navigator for your use case - probably you could just copy & past StackNavigator and remove transitions from there. I will also investigate how to solve this problem... |
Looks like we could add this functionality to RNRF using PR is welcome! |
Did this get resolved? Interested in contributing to this. |
@JoshStaff Feel free to submit PR |
Okey, closing this ticket for now. As I found nice workaround by passing Also I will add P.S. I've just updated Example to make 'Login' animation as standard android 'fade' animation. |
You an use your custom transition effects like as follow:
|
Uh oh!
There was an error while loading. Please reload this page.
In v3 we can use
duration={0}
to diable the transition aimation. V4 no longer has theduration
prop and the doc suggest we should implement custom navigator now instead and pass it as ‘navigator’ prop. Being not familiar with React Navigation, I was wondering if anyone have an example on how to do this?Thanks 👍
The text was updated successfully, but these errors were encountered: