From c1282997c019bb4c912c9340f6b055854486852f Mon Sep 17 00:00:00 2001 From: Andrey Efremov <11088992+gazedash@users.noreply.github.com> Date: Fri, 22 Mar 2019 11:09:58 +0300 Subject: [PATCH] Fix LayoutAnimation.easeInEaseOut bug More info here https://github.com/facebook/react-native/issues/16895 --- index.js | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/index.js b/index.js index afc1e679..1af5d672 100644 --- a/index.js +++ b/index.js @@ -27,17 +27,17 @@ const initialState = { // Note using LayoutAnimation.easeInEaseOut() was causing blank spaces to // show up in list: https://github.com/facebook/react-native/issues/13207 -const layoutAnimConfig = { - duration: 300, - create: { - type: LayoutAnimation.Types.easeInEaseOut, - property: LayoutAnimation.Properties.scaleXY, - }, - update: { - type: LayoutAnimation.Types.easeInEaseOut, - property: LayoutAnimation.Properties.scaleXY, - } -} +// const layoutAnimConfig = { +// duration: 300, +// create: { +// type: LayoutAnimation.Types.easeInEaseOut, +// property: LayoutAnimation.Properties.scaleXY, +// }, +// update: { +// type: LayoutAnimation.Types.easeInEaseOut, +// property: LayoutAnimation.Properties.scaleXY, +// } +// } class SortableFlatList extends Component { _moveAnim = new Animated.Value(0) @@ -191,7 +191,7 @@ class SortableFlatList extends Component { if (activeRow === -1) return const nextSpacerIndex = this.getSpacerIndex(this._move, activeRow) if (nextSpacerIndex > -1 && nextSpacerIndex !== this._spacerIndex) { - LayoutAnimation.configureNext(layoutAnimConfig); + // LayoutAnimation.configureNext(layoutAnimConfig); this.setState({ spacerIndex: nextSpacerIndex }) this._spacerIndex = nextSpacerIndex if (nextSpacerIndex === data.length) this._flatList.scrollToEnd() @@ -442,4 +442,4 @@ const styles = StyleSheet.create({ }, wrapper: { flex: 1, opacity: 1 }, fullOpacity: { opacity: 1 } -}) \ No newline at end of file +})