nearform / polaris

NearForm multi-platform application accelerator
Apache License 2.0
35 stars 8 forks source link

Apply native view switching animations #36

Open AlanSl opened 4 years ago

AlanSl commented 4 years ago

StackNavigator has built-in view transition animation, DrawerNavigator doesn't, so we lost the nice built-in iOS animations on switching to DrawerNavigator.

Adding such animations to DrawerNavigator would be a good accelerator-friendly example of how to apply custom transition animations that devs can build on.

React Navigation's default iOS stack animations are nice and should be emulated. The Android default animations are less impressive, so it might be worth doing some research to look for something with a native feel that is a bit better.


I do not recommend using nested navigators for this. Many people use DrawerNavigator inside StackNavigator or StackNavigator inside DrawerNavigator as a quick-fix for things like this, but it has nasty side effects:

With just one non-nested navigator, it's easy to go anywhere from anywhere, and it's much easier to create simple similar developer experience for linking views in native and web.

AlanSl commented 4 years ago

I'm working on this alongside https://github.com/nearform/polaris/issues/42 as that requires some work on the native Navigator to stop it crashing Jest