|
1 | 1 | import React, { useCallback, useRef, useState } from 'react'; |
2 | 2 | import { StyleSheet, Switch, Text, View } from 'react-native'; |
3 | 3 | import { GestureDetector, usePanGesture } from 'react-native-gesture-handler'; |
4 | | -import { |
5 | | - COLORS, |
6 | | - Feedback, |
7 | | - FeedbackHandle, |
8 | | - commonStyles, |
9 | | -} from '../../../common'; |
| 4 | + |
| 5 | +import type { FeedbackHandle } from '../../../common'; |
| 6 | +import { COLORS, commonStyles, Feedback } from '../../../common'; |
10 | 7 |
|
11 | 8 | // Validates that when two Gesture Handler recognizers are active at the same |
12 | 9 | // time, both with cancelsJSResponder set to true, finishing ONE of them does |
@@ -47,17 +44,17 @@ export function MultiHandlerExample() { |
47 | 44 | runOnJS: true, |
48 | 45 | cancelsJSResponder, |
49 | 46 | onActivate: () => pushEvent('GH_A ACTIVE'), |
50 | | - onFinalize: (_e, success) => |
51 | | - pushEvent(`GH_A finalize (${success ? 'success' : 'cancel/fail'})`), |
| 47 | + onFinalize: (e) => |
| 48 | + pushEvent(`GH_A finalize (${e.canceled ? 'cancel/fail' : 'success'})`), |
52 | 49 | }); |
53 | 50 |
|
54 | 51 | const panB = usePanGesture({ |
55 | 52 | minDistance: 8, |
56 | 53 | runOnJS: true, |
57 | 54 | cancelsJSResponder, |
58 | 55 | onActivate: () => pushEvent('GH_B ACTIVE'), |
59 | | - onFinalize: (_e, success) => |
60 | | - pushEvent(`GH_B finalize (${success ? 'success' : 'cancel/fail'})`), |
| 56 | + onFinalize: (e) => |
| 57 | + pushEvent(`GH_B finalize (${e.canceled ? 'cancel/fail' : 'success'})`), |
61 | 58 | }); |
62 | 59 |
|
63 | 60 | const clearLog = useCallback(() => { |
|
0 commit comments