-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Pass transitionConfig to Navigator #2062
Conversation
@alexwasner, thanks for your PR! By analyzing the history of the files in this pull request, we identified @aksonov, @Swordsman-Inaction and @diegocouto to be potential reviewers. |
Could you describe all steps? Why you can't just pass transitionConfig as prop to Router (it will be passed to all navigators automatically)? |
@aksonov You would pass transitionConfig to the Router and all navigators would get it
I also realized this doesn't work with the LightboxNavigator yet so I'll dig into that |
I've tried a few things to get |
I've just tested your animations and it works great without modification (just bypass to Router)! I've just added transitionConfig to Lightbox Navigator right now but it will not work, because LightboxNavigator doesn't use transitionAnimation now - feel free to submit PR (it is accessible via tabsConfig.transitionConfig). Also it will be great if we could preserve default animations somehow for modal/push and extend animations for other custom animation so I could include it into Example - I tried your config and it changes all animations within the app, so I postponed changes until we have default/native push/modal + custom ones. |
Also disabled animations will be very helpful (so we could use duration={0} to disable animations for some scenes) |
This is actually already working without my changes when you just pass it to router as transitionConfig. I'll see if I can find a workaround for the duration thing. Perhaps something with navigationStore to cache the state or something. Closing this and will open a new PR with that😂 |
Oh and @aksonov, you can also just pass the default params like this:
|
Great! Is it possible to import ready ones from ReactNavigation? |
Oh, I see CardStackStyleInterpolator.forHorizontal is already used, so only duration and easing is 'duplicated'. |
So could we pass duration individually for scene? |
I haven’t found a way to override transitionSpec per view yet, but still digging |
I have tried to use that your 'default' config, but it doesn't work for modals... |
With this PR, you can create a custom transition and pass it via
transitionConfig
to the Router. You can choose the transition type when routing withExample: