@@ -57,10 +57,7 @@ export default class SortableList extends Component {
57
57
activeRowIndex : null ,
58
58
releasedRowKey : null ,
59
59
sortingEnabled : this . props . sortingEnabled ,
60
- scrollEnabled : this . props . scrollEnabled ,
61
- style : {
62
- opacity : new Animated . Value ( 0 ) ,
63
- } ,
60
+ scrollEnabled : this . props . scrollEnabled
64
61
} ;
65
62
66
63
componentDidMount ( ) {
@@ -72,16 +69,14 @@ export default class SortableList extends Component {
72
69
const { data : nextData , order : nextOrder } = nextProps ;
73
70
74
71
if ( data && nextData && ! shallowEqual ( data , nextData ) ) {
75
- this . _animateRowsDisappearance ( ( ) => {
76
- uniqueRowKey . id ++ ;
77
- this . _areRowsAnimated = false ;
78
- this . _rowsLayouts = [ ] ;
79
- this . setState ( {
80
- data : nextData ,
81
- containerLayout : null ,
82
- rowsLayouts : null ,
83
- order : nextOrder || Object . keys ( nextData )
84
- } ) ;
72
+ uniqueRowKey . id ++ ;
73
+ this . _areRowsAnimated = false ;
74
+ this . _rowsLayouts = [ ] ;
75
+ this . setState ( {
76
+ data : nextData ,
77
+ containerLayout : null ,
78
+ rowsLayouts : null ,
79
+ order : nextOrder || Object . keys ( nextData )
85
80
} ) ;
86
81
87
82
} else if ( order && nextOrder && ! shallowEqual ( order , nextOrder ) ) {
@@ -150,9 +145,8 @@ export default class SortableList extends Component {
150
145
}
151
146
152
147
render ( ) {
153
- const { contentContainerStyle, horizontal} = this . props ;
148
+ const { contentContainerStyle, horizontal, style : containerStyle } = this . props ;
154
149
const { contentHeight, contentWidth, scrollEnabled} = this . state ;
155
- const containerStyle = StyleSheet . flatten ( [ this . props . style , this . state . style ] ) ;
156
150
const innerContainerStyle = [ styles . container ] ;
157
151
158
152
if ( horizontal ) {
@@ -267,25 +261,11 @@ export default class SortableList extends Component {
267
261
rowsLayouts : rowsLayoutsByKey ,
268
262
contentHeight,
269
263
contentWidth,
270
- } , ( ) => {
271
- this . _animateRowsAppearance ( ( ) => ( this . _areRowsAnimated = true ) ) ;
272
- } ) ;
264
+ } , ( ) => ( this . _areRowsAnimated = true ) ) ;
273
265
} ) ;
274
266
} ) ;
275
267
}
276
268
277
- _animateRowsAppearance ( onAnimationEnd ) {
278
- Animated . timing ( this . state . style . opacity , {
279
- toValue : 1 ,
280
- } ) . start ( onAnimationEnd ) ;
281
- }
282
-
283
- _animateRowsDisappearance ( onAnimationEnd ) {
284
- Animated . timing ( this . state . style . opacity , {
285
- toValue : 0 ,
286
- } ) . start ( onAnimationEnd ) ;
287
- }
288
-
289
269
_scroll ( animated ) {
290
270
this . _scrollView . scrollTo ( { ...this . _contentOffset , animated} ) ;
291
271
}
0 commit comments