Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3532280
D10012.id33656.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D10012.id33656.diff
View Options
diff --git a/native/flow-typed/npm/@react-navigation/core_v6.x.x.js b/native/flow-typed/npm/@react-navigation/core_v6.x.x.js
--- a/native/flow-typed/npm/@react-navigation/core_v6.x.x.js
+++ b/native/flow-typed/npm/@react-navigation/core_v6.x.x.js
@@ -2152,6 +2152,11 @@
+independent?: boolean,
|};
+ declare export type UnsafeContainerActionEvent = {|
+ +action: GenericNavigationAction,
+ +noop: boolean,
+ |};
+
declare export type ContainerEventMap = {|
...GlobalEventMap<PossiblyStaleNavigationState>,
+options: {|
@@ -2159,10 +2164,7 @@
+canPreventDefault: false,
|},
+__unsafe_action__: {|
- +data: {|
- +action: GenericNavigationAction,
- +noop: boolean,
- |},
+ +data: UnsafeContainerActionEvent,
+canPreventDefault: false,
|},
|};
diff --git a/native/root.react.js b/native/root.react.js
--- a/native/root.react.js
+++ b/native/root.react.js
@@ -3,7 +3,10 @@
import { ActionSheetProvider } from '@expo/react-native-action-sheet';
import { BottomSheetModalProvider } from '@gorhom/bottom-sheet';
import AsyncStorage from '@react-native-async-storage/async-storage';
-import type { PossiblyStaleNavigationState } from '@react-navigation/core';
+import type {
+ PossiblyStaleNavigationState,
+ UnsafeContainerActionEvent,
+} from '@react-navigation/core';
import { useReduxDevToolsExtension } from '@react-navigation/devtools';
import { NavigationContainer } from '@react-navigation/native';
import * as SplashScreen from 'expo-splash-screen';
@@ -215,18 +218,21 @@
if (!navContainer) {
return undefined;
}
- return navContainer.addListener('__unsafe_action__', event => {
- const { action, noop } = event.data;
- const navState = navStateRef.current;
- if (noop) {
- actionLogger.addOtherAction('navState', action, navState, navState);
- return;
- }
- queuedActionsRef.current.push({
- ...action,
- type: `NAV/${action.type}`,
- });
- });
+ return navContainer.addListener(
+ '__unsafe_action__',
+ (event: { +data: UnsafeContainerActionEvent, ... }) => {
+ const { action, noop } = event.data;
+ const navState = navStateRef.current;
+ if (noop) {
+ actionLogger.addOtherAction('navState', action, navState, navState);
+ return;
+ }
+ queuedActionsRef.current.push({
+ ...action,
+ type: `NAV/${action.type}`,
+ });
+ },
+ );
}, [navContainer]);
const activeTheme = useSelector(state => state.globalThemeInfo.activeTheme);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Dec 26, 9:00 AM (10 h, 34 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2703249
Default Alt Text
D10012.id33656.diff (2 KB)
Attached To
Mode
D10012: [Flow202][native][skip-ci] [28/x] Type ReactNav __unsafe_action__ container event
Attached
Detach File
Event Timeline
Log In to Comment