fix: disable react-native-screens on iOS for older versions

This commit is contained in:
Satyajit Sahoo
2020-11-04 22:31:47 +01:00
parent e3e58c2d89
commit ce7d20e336
3 changed files with 5 additions and 4 deletions

View File

@@ -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;
};

View File

@@ -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;