File tree Expand file tree Collapse file tree 3 files changed +63
-0
lines changed Expand file tree Collapse file tree 3 files changed +63
-0
lines changed Original file line number Diff line number Diff line change @@ -101,6 +101,7 @@ import Test2028 from './src/Test2028';
101
101
import Test2048 from './src/Test2048' ;
102
102
import Test2069 from './src/Test2069' ;
103
103
import Test2118 from './src/Test2118' ;
104
+ import Test2184 from './src/Test2184' ;
104
105
import TestScreenAnimation from './src/TestScreenAnimation' ;
105
106
106
107
enableFreeze ( true ) ;
Original file line number Diff line number Diff line change
1
+ import React , { useEffect } from 'react' ;
2
+ import { Button } from 'react-native' ;
3
+ import { NavigationContainer , ParamListBase } from '@react-navigation/native' ;
4
+ import {
5
+ createNativeStackNavigator ,
6
+ NativeStackNavigationProp ,
7
+ } from '@react-navigation/native-stack' ;
8
+
9
+ const Stack = createNativeStackNavigator ( ) ;
10
+
11
+ export default function App ( ) {
12
+ return (
13
+ < NavigationContainer >
14
+ < Stack . Navigator >
15
+ < Stack . Screen name = "First" component = { First } />
16
+ < Stack . Screen
17
+ name = "Second"
18
+ component = { Second }
19
+ options = { { presentation : 'modal' , gestureEnabled : false } }
20
+ />
21
+ </ Stack . Navigator >
22
+ </ NavigationContainer >
23
+ ) ;
24
+ }
25
+
26
+ type Props = {
27
+ navigation : NativeStackNavigationProp < ParamListBase > ;
28
+ } ;
29
+
30
+ const First = ( { navigation } : Props ) : JSX . Element => {
31
+ return (
32
+ < Button
33
+ title = "Tap me for second screen"
34
+ onPress = { ( ) => navigation . navigate ( 'Second' ) }
35
+ />
36
+ ) ;
37
+ } ;
38
+
39
+ const Second = ( { navigation } : Props ) : JSX . Element => {
40
+ useEffect ( ( ) => {
41
+ const unsubscribe = navigation . addListener ( 'gestureCancel' , ( ) => {
42
+ console . log ( 'gestureCancel' ) ;
43
+ } ) ;
44
+
45
+ return unsubscribe ;
46
+ } , [ navigation ] ) ;
47
+
48
+ return (
49
+ < Button
50
+ title = "Tap me for first screen"
51
+ onPress = { ( ) => navigation . goBack ( ) }
52
+ />
53
+ ) ;
54
+ } ;
Original file line number Diff line number Diff line change @@ -521,6 +521,14 @@ - (void)notifyTransitionProgress:(double)progress closing:(BOOL)closing goingFor
521
521
#endif
522
522
}
523
523
524
+ #if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && defined(__IPHONE_13_0) && \
525
+ __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0
526
+ - (void )presentationControllerDidAttemptToDismiss : (UIPresentationController *)presentationController
527
+ {
528
+ [self notifyGestureCancel ];
529
+ }
530
+ #endif
531
+
524
532
- (void )presentationControllerWillDismiss : (UIPresentationController *)presentationController
525
533
{
526
534
// We need to call both "cancel" and "reset" here because RN's gesture recognizer
You can’t perform that action at this time.
0 commit comments