From 0a8404d7232278bb199ca048a1113c83d10b656b Mon Sep 17 00:00:00 2001 From: Diego Mello Date: Wed, 30 Oct 2019 12:43:57 -0300 Subject: [PATCH] [REGRESSION] Use LayoutAnimation instead of Transition API (#1338) --- app/index.js | 15 ++++++-------- app/share.js | 15 ++++++-------- app/utils/layoutAnimation.js | 38 ++---------------------------------- 3 files changed, 14 insertions(+), 54 deletions(-) diff --git a/app/index.js b/app/index.js index 9782714fb..96ceae5fe 100644 --- a/app/index.js +++ b/app/index.js @@ -19,7 +19,6 @@ import { defaultHeader, onNavigationStateChange } from './utils/navigation'; import { loggerConfig, analytics } from './utils/log'; import Toast from './containers/Toast'; import RocketChat from './lib/rocketchat'; -import LayoutAnimation from './utils/layoutAnimation'; useScreens(); @@ -313,14 +312,12 @@ export default class Root extends React.Component { render() { return ( - - { - Navigation.setTopLevelNavigator(navigatorRef); - }} - onNavigationStateChange={onNavigationStateChange} - /> - + { + Navigation.setTopLevelNavigator(navigatorRef); + }} + onNavigationStateChange={onNavigationStateChange} + /> ); } diff --git a/app/share.js b/app/share.js index 73d6f06b4..2374afe2a 100644 --- a/app/share.js +++ b/app/share.js @@ -11,7 +11,6 @@ import sharedStyles from './views/Styles'; import { isNotch, isIOS } from './utils/deviceInfo'; import { defaultHeader, onNavigationStateChange } from './utils/navigation'; import RocketChat from './lib/rocketchat'; -import LayoutAnimation from './utils/layoutAnimation'; const InsideNavigator = createStackNavigator({ ShareListView: { @@ -85,14 +84,12 @@ class Root extends React.Component { onLayout={this.handleLayout} > - - { - Navigation.setTopLevelNavigator(navigatorRef); - }} - onNavigationStateChange={onNavigationStateChange} - /> - + { + Navigation.setTopLevelNavigator(navigatorRef); + }} + onNavigationStateChange={onNavigationStateChange} + /> ); diff --git a/app/utils/layoutAnimation.js b/app/utils/layoutAnimation.js index a558404cd..3b4292d35 100644 --- a/app/utils/layoutAnimation.js +++ b/app/utils/layoutAnimation.js @@ -1,44 +1,10 @@ -import React from 'react'; -import { Transition, Transitioning } from 'react-native-reanimated'; -import PropTypes from 'prop-types'; +import { LayoutAnimation } from 'react-native'; import debounce from './debounce'; import { isIOS } from './deviceInfo'; -import sharedStyles from '../views/Styles'; - -const transition = ( - - - - - -); - -const TRANSITION_REF = React.createRef(); export const animateNextTransition = debounce(() => { if (isIOS) { - TRANSITION_REF.current.animateNextTransition(); + LayoutAnimation.easeInEaseOut(); } }, 200, true); - -const LayoutAnimation = ({ children }) => { - if (isIOS) { - return ( - - {children} - - ); - } - return children; -}; - -LayoutAnimation.propTypes = { - children: PropTypes.node -}; - -export default LayoutAnimation;