From 5636e41cf378f76122d87ce455c66dc1b3d50ba5 Mon Sep 17 00:00:00 2001 From: Satyajit Sahoo Date: Fri, 26 Jun 2020 16:03:40 +0200 Subject: [PATCH] fix: disable tab switching animation by default in bottom navigation (#2017) --- src/components/BottomNavigation.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/BottomNavigation.tsx b/src/components/BottomNavigation.tsx index bf268975f3..e99659928b 100644 --- a/src/components/BottomNavigation.tsx +++ b/src/components/BottomNavigation.tsx @@ -394,6 +394,7 @@ class BottomNavigation extends React.Component { static defaultProps = { labeled: true, keyboardHidesNavigationBar: true, + sceneAnimationEnabled: false, }; static getDerivedStateFromProps(nextProps: any, prevState: State) { @@ -710,8 +711,11 @@ class BottomNavigation extends React.Component { } const focused = navigationState.index === index; - const opacity = - sceneAnimationEnabled !== false ? tabs[index] : focused ? 1 : 0; + const opacity = sceneAnimationEnabled + ? tabs[index] + : focused + ? 1 + : 0; const top = offsets[index].interpolate({ inputRange: [0, 1],