mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-04-24 04:25:34 +08:00
fix: disable react-native-screens on iOS for older versions
This commit is contained in:
@@ -369,7 +369,7 @@ export type StackNavigationConfig = {
|
||||
/**
|
||||
* Whether inactive screens should be detached from the view hierarchy to save memory.
|
||||
* Make sure to call `enableScreens` from `react-native-screens` to make it work.
|
||||
* Defaults to `true`.
|
||||
* Defaults to `true` on Android, depends on the version of `react-native-screens` on iOS.
|
||||
*/
|
||||
detachInactiveScreens?: boolean;
|
||||
};
|
||||
|
||||
@@ -396,8 +396,9 @@ export default class CardStack extends React.Component<Props, State> {
|
||||
onGestureStart,
|
||||
onGestureEnd,
|
||||
onGestureCancel,
|
||||
// Enable on new versions of screens or for non modals on older versions
|
||||
detachInactiveScreens = shouldUseActivityState || mode !== 'modal',
|
||||
// Enable on new versions of `react-native-screens`
|
||||
// On older versions of `react-native-screens`, there's an issue with screens not being responsive to user interaction.
|
||||
detachInactiveScreens = shouldUseActivityState,
|
||||
} = this.props;
|
||||
|
||||
const { scenes, layout, gestures, headerHeights } = this.state;
|
||||
|
||||
Reference in New Issue
Block a user