mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-01-12 22:51:18 +08:00
fix: enable screens only on supported platforms (#9494)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import * as React from 'react';
|
||||
import { StyleSheet } from 'react-native';
|
||||
import { StyleSheet, Platform } from 'react-native';
|
||||
import { ScreenContainer } from 'react-native-screens';
|
||||
import { SafeAreaInsetsContext } from 'react-native-safe-area-context';
|
||||
import {
|
||||
@@ -40,7 +40,9 @@ export default function BottomTabView(props: Props) {
|
||||
navigation,
|
||||
descriptors,
|
||||
safeAreaInsets,
|
||||
detachInactiveScreens = true,
|
||||
detachInactiveScreens = Platform.OS === 'web' ||
|
||||
Platform.OS === 'android' ||
|
||||
Platform.OS === 'ios',
|
||||
sceneContainerStyle,
|
||||
} = props;
|
||||
|
||||
|
||||
@@ -76,7 +76,9 @@ function DrawerViewBase({
|
||||
drawerContent = (props: DrawerContentComponentProps) => (
|
||||
<DrawerContent {...props} />
|
||||
),
|
||||
detachInactiveScreens = true,
|
||||
detachInactiveScreens = Platform.OS === 'web' ||
|
||||
Platform.OS === 'android' ||
|
||||
Platform.OS === 'ios',
|
||||
// Running in chrome debugger
|
||||
// @ts-expect-error
|
||||
useLegacyImplementation = !global.nativeCallSyncHook ||
|
||||
|
||||
@@ -461,9 +461,9 @@ export default class CardStack extends React.Component<Props, State> {
|
||||
onGestureStart,
|
||||
onGestureEnd,
|
||||
onGestureCancel,
|
||||
// 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 = true,
|
||||
detachInactiveScreens = Platform.OS === 'web' ||
|
||||
Platform.OS === 'android' ||
|
||||
Platform.OS === 'ios',
|
||||
} = this.props;
|
||||
|
||||
const { scenes, layout, gestures, headerHeights } = this.state;
|
||||
|
||||
Reference in New Issue
Block a user