@@ -49,6 +49,14 @@ const {
4949// Fire onScrollComplete when within this many
5050// px of target offset
5151const onScrollCompleteThreshold = 2
52+ const defaultAnimationConfig = {
53+ damping : 20 ,
54+ mass : 0.2 ,
55+ stiffness : 100 ,
56+ overshootClamping : false ,
57+ restSpeedThreshold : 0.2 ,
58+ restDisplacementThreshold : 0.2 ,
59+ }
5260
5361const debugGestureState = ( state , context ) => {
5462 const stateStr = Object . entries ( GestureState ) . find ( ( [ k , v ] ) => v === state )
@@ -155,6 +163,7 @@ class DraggableFlatList<T> extends React.Component<Props<T>, State> {
155163 }
156164
157165 hoverAnimConfig = {
166+ ...defaultAnimationConfig ,
158167 ...this . props . animationConfig ,
159168 toValue : sub ( this . hoverTo , sub ( this . scrollOffset , this . hoverScrollSnapshot ) ) ,
160169 }
@@ -193,14 +202,7 @@ class DraggableFlatList<T> extends React.Component<Props<T>, State> {
193202 static defaultProps = {
194203 autoscrollThreshold : 30 ,
195204 autoScrollSpeed : 100 ,
196- animationConfig : {
197- damping : 20 ,
198- mass : 0.2 ,
199- stiffness : 100 ,
200- overshootClamping : false ,
201- restSpeedThreshold : 0.2 ,
202- restDisplacementThreshold : 0.2 ,
203- } ,
205+ animationConfig : { } ,
204206 }
205207
206208 constructor ( props : Props < T > ) {
0 commit comments