Skip to content

Commit 3f7c16e

Browse files
committed
fix types
1 parent 403a750 commit 3f7c16e

4 files changed

Lines changed: 17 additions & 20 deletions

File tree

apps/common-app/src/new_api/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ import PointerTypeExample from './tests/pointerType';
4040
import PressableExample from './tests/pressable';
4141
import ReattachingExample from './tests/reattaching';
4242
import RectButtonExample from './tests/rectButton';
43+
import RNResponderCancellationExample from './tests/rnResponderCancellation';
4344
import TwoFingerPanExample from './tests/twoFingerPan';
4445
import WebStylesResetExample from './tests/webStylesReset';
45-
import RNResponderCancellationExample from './tests/rnResponderCancellation';
4646

4747
export const NEW_EXAMPLES: ExamplesSection[] = [
4848
{

apps/common-app/src/new_api/tests/rnResponderCancellation/MultiHandlerExample.tsx

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
import React, { useCallback, useRef, useState } from 'react';
22
import { StyleSheet, Switch, Text, View } from 'react-native';
33
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';
107

118
// Validates that when two Gesture Handler recognizers are active at the same
129
// time, both with cancelsJSResponder set to true, finishing ONE of them does
@@ -47,17 +44,17 @@ export function MultiHandlerExample() {
4744
runOnJS: true,
4845
cancelsJSResponder,
4946
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'})`),
5249
});
5350

5451
const panB = usePanGesture({
5552
minDistance: 8,
5653
runOnJS: true,
5754
cancelsJSResponder,
5855
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'})`),
6158
});
6259

6360
const clearLog = useCallback(() => {

apps/common-app/src/new_api/tests/rnResponderCancellation/SingleHandlerExample.tsx

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
import React, { useCallback, useRef, useState } from 'react';
22
import { StyleSheet, Switch, Text, View } from 'react-native';
33
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';
107

118
const SINGLE_MAX_EVENTS = 8;
129

@@ -32,8 +29,10 @@ export function SingleHandlerExample() {
3229
onActivate: () => {
3330
pushEvent('GH pan ACTIVE');
3431
},
35-
onFinalize: (_event, success) => {
36-
pushEvent(`GH pan finalize (${success ? 'success' : 'cancel/fail'})`);
32+
onFinalize: (event) => {
33+
pushEvent(
34+
`GH pan finalize (${event.canceled ? 'cancel/fail' : 'success'})`
35+
);
3736
},
3837
});
3938

apps/common-app/src/new_api/tests/rnResponderCancellation/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import React, { useState } from 'react';
22
import { Pressable, StyleSheet, Text, View } from 'react-native';
3+
34
import { COLORS } from '../../../common';
4-
import { SingleHandlerExample } from './SingleHandlerExample';
55
import { MultiHandlerExample } from './MultiHandlerExample';
6+
import { SingleHandlerExample } from './SingleHandlerExample';
67

78
type Tab = 'single' | 'multi';
89

0 commit comments

Comments
 (0)