@@ -72,14 +72,17 @@ export default function Draggable(props) {
72
72
} , [ x , y ] ) ;
73
73
74
74
const shouldStartDrag = React . useCallback (
75
- gs => {
75
+ ( gs ) => {
76
76
return ! disabled && ( Math . abs ( gs . dx ) > 2 || Math . abs ( gs . dy ) > 2 ) ;
77
77
} ,
78
78
[ disabled ] ,
79
79
) ;
80
80
81
81
const reversePosition = React . useCallback ( ( ) => {
82
- Animated . spring ( pan . current , { toValue : { x : 0 , y : 0 } } ) . start ( ) ;
82
+ Animated . spring ( pan . current , {
83
+ toValue : { x : 0 , y : 0 } ,
84
+ useNativeDriver : false ,
85
+ } ) . start ( ) ;
83
86
} , [ pan ] ) ;
84
87
85
88
const onPanResponderRelease = React . useCallback (
@@ -138,7 +141,10 @@ export default function Draggable(props) {
138
141
onMoveShouldSetPanResponderCapture : ( _ , gestureState ) =>
139
142
shouldStartDrag ( gestureState ) ,
140
143
onPanResponderGrant,
141
- onPanResponderMove : Animated . event ( [ ] , { listener : handleOnDrag } ) ,
144
+ onPanResponderMove : Animated . event ( [ ] , {
145
+ listener : handleOnDrag ,
146
+ useNativeDriver : false ,
147
+ } ) ,
142
148
onPanResponderRelease,
143
149
} ) ;
144
150
} , [
@@ -152,7 +158,7 @@ export default function Draggable(props) {
152
158
React . useEffect ( ( ) => {
153
159
const curPan = pan . current ; // Using an instance to avoid losing the pointer before the cleanup
154
160
if ( ! shouldReverse ) {
155
- curPan . addListener ( c => ( offsetFromStart . current = c ) ) ;
161
+ curPan . addListener ( ( c ) => ( offsetFromStart . current = c ) ) ;
156
162
}
157
163
return ( ) => {
158
164
curPan . removeAllListeners ( ) ;
@@ -175,7 +181,7 @@ export default function Draggable(props) {
175
181
top : y ,
176
182
left : x ,
177
183
elevation : z ,
178
- z,
184
+ zIndex : z ,
179
185
} ;
180
186
if ( renderColor ) {
181
187
style . backgroundColor = renderColor ;
@@ -213,13 +219,13 @@ export default function Draggable(props) {
213
219
}
214
220
} , [ children , imageSource , renderSize , renderText ] ) ;
215
221
216
- const handleOnLayout = React . useCallback ( event => {
222
+ const handleOnLayout = React . useCallback ( ( event ) => {
217
223
const { height, width} = event . nativeEvent . layout ;
218
224
childSize . current = { x : width , y : height } ;
219
225
} , [ ] ) ;
220
226
221
227
const handlePressOut = React . useCallback (
222
- event => {
228
+ ( event ) => {
223
229
onPressOut ( event ) ;
224
230
if ( ! isDragging . current ) {
225
231
onRelease ( event , false ) ;
0 commit comments