Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F32167905
D5415.1765054295.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
5 KB
Referenced Files
None
Subscribers
None
D5415.1765054295.diff
View Options
diff --git a/native/flow-typed/npm/@react-navigation/bottom-tabs_v5.x.x.js b/native/flow-typed/npm/@react-navigation/bottom-tabs_v5.x.x.js
--- a/native/flow-typed/npm/@react-navigation/bottom-tabs_v5.x.x.js
+++ b/native/flow-typed/npm/@react-navigation/bottom-tabs_v5.x.x.js
@@ -1381,6 +1381,7 @@
+gestureResponseDistance: {| vertical?: number, horizontal?: number |},
+gestureVelocityImpact: number,
+safeAreaInsets: $Partial<EdgeInsets>,
+ +keyboardHandlingEnabled: boolean,
// Transition
...TransitionPreset,
// Header
@@ -1471,7 +1472,6 @@
declare type StackNavigationConfig = {|
+mode?: 'card' | 'modal',
+headerMode?: 'float' | 'screen' | 'none',
- +keyboardHandlingEnabled?: boolean,
+detachInactiveScreens?: boolean,
|};
diff --git a/native/flow-typed/npm/@react-navigation/devtools_v5.x.x.js b/native/flow-typed/npm/@react-navigation/devtools_v5.x.x.js
--- a/native/flow-typed/npm/@react-navigation/devtools_v5.x.x.js
+++ b/native/flow-typed/npm/@react-navigation/devtools_v5.x.x.js
@@ -1381,6 +1381,7 @@
+gestureResponseDistance: {| vertical?: number, horizontal?: number |},
+gestureVelocityImpact: number,
+safeAreaInsets: $Partial<EdgeInsets>,
+ +keyboardHandlingEnabled: boolean,
// Transition
...TransitionPreset,
// Header
@@ -1471,7 +1472,6 @@
declare type StackNavigationConfig = {|
+mode?: 'card' | 'modal',
+headerMode?: 'float' | 'screen' | 'none',
- +keyboardHandlingEnabled?: boolean,
+detachInactiveScreens?: boolean,
|};
diff --git a/native/flow-typed/npm/@react-navigation/material-top-tabs_v5.x.x.js b/native/flow-typed/npm/@react-navigation/material-top-tabs_v5.x.x.js
--- a/native/flow-typed/npm/@react-navigation/material-top-tabs_v5.x.x.js
+++ b/native/flow-typed/npm/@react-navigation/material-top-tabs_v5.x.x.js
@@ -1381,6 +1381,7 @@
+gestureResponseDistance: {| vertical?: number, horizontal?: number |},
+gestureVelocityImpact: number,
+safeAreaInsets: $Partial<EdgeInsets>,
+ +keyboardHandlingEnabled: boolean,
// Transition
...TransitionPreset,
// Header
@@ -1471,7 +1472,6 @@
declare type StackNavigationConfig = {|
+mode?: 'card' | 'modal',
+headerMode?: 'float' | 'screen' | 'none',
- +keyboardHandlingEnabled?: boolean,
+detachInactiveScreens?: boolean,
|};
diff --git a/native/flow-typed/npm/@react-navigation/native_v5.x.x.js b/native/flow-typed/npm/@react-navigation/native_v5.x.x.js
--- a/native/flow-typed/npm/@react-navigation/native_v5.x.x.js
+++ b/native/flow-typed/npm/@react-navigation/native_v5.x.x.js
@@ -1381,6 +1381,7 @@
+gestureResponseDistance: {| vertical?: number, horizontal?: number |},
+gestureVelocityImpact: number,
+safeAreaInsets: $Partial<EdgeInsets>,
+ +keyboardHandlingEnabled: boolean,
// Transition
...TransitionPreset,
// Header
@@ -1471,7 +1472,6 @@
declare type StackNavigationConfig = {|
+mode?: 'card' | 'modal',
+headerMode?: 'float' | 'screen' | 'none',
- +keyboardHandlingEnabled?: boolean,
+detachInactiveScreens?: boolean,
|};
diff --git a/native/flow-typed/npm/@react-navigation/stack_v5.x.x.js b/native/flow-typed/npm/@react-navigation/stack_v5.x.x.js
--- a/native/flow-typed/npm/@react-navigation/stack_v5.x.x.js
+++ b/native/flow-typed/npm/@react-navigation/stack_v5.x.x.js
@@ -1381,6 +1381,7 @@
+gestureResponseDistance: {| vertical?: number, horizontal?: number |},
+gestureVelocityImpact: number,
+safeAreaInsets: $Partial<EdgeInsets>,
+ +keyboardHandlingEnabled: boolean,
// Transition
...TransitionPreset,
// Header
@@ -1471,7 +1472,6 @@
declare type StackNavigationConfig = {|
+mode?: 'card' | 'modal',
+headerMode?: 'float' | 'screen' | 'none',
- +keyboardHandlingEnabled?: boolean,
+detachInactiveScreens?: boolean,
|};
diff --git a/native/navigation/root-navigator.react.js b/native/navigation/root-navigator.react.js
--- a/native/navigation/root-navigator.react.js
+++ b/native/navigation/root-navigator.react.js
@@ -63,18 +63,31 @@
id,
...rest
}: RootNavigatorProps) {
+ const [keyboardHandlingEnabled, setKeyboardHandlingEnabled] = React.useState(
+ true,
+ );
+ const mergedScreenOptions = React.useMemo(() => {
+ if (typeof screenOptions === 'function') {
+ return input => ({
+ ...screenOptions(input),
+ keyboardHandlingEnabled,
+ });
+ }
+ return {
+ ...screenOptions,
+ keyboardHandlingEnabled,
+ };
+ }, [screenOptions, keyboardHandlingEnabled]);
+
const { state, descriptors, navigation } = useNavigationBuilder(RootRouter, {
id,
initialRouteName,
children,
- screenOptions,
+ screenOptions: mergedScreenOptions,
defaultScreenOptions,
screenListeners,
});
- const [keyboardHandlingEnabled, setKeyboardHandlingEnabled] = React.useState(
- true,
- );
const rootNavigationContext = React.useMemo(
() => ({ setKeyboardHandlingEnabled }),
[setKeyboardHandlingEnabled],
@@ -87,7 +100,6 @@
state={state}
descriptors={descriptors}
navigation={navigation}
- keyboardHandlingEnabled={keyboardHandlingEnabled}
detachInactiveScreens={Platform.OS !== 'ios'}
/>
</RootNavigatorContext.Provider>
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Dec 6, 8:51 PM (14 h, 54 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5840740
Default Alt Text
D5415.1765054295.diff (5 KB)
Attached To
Mode
D5415: [native] [22/34] ReactNav6: Move keyboardHandlingEnabled to StackOptions
Attached
Detach File
Event Timeline
Log In to Comment