UNPKG

829 BPlain TextView Raw
1import { BackHandler, Platform } from 'react-native';
2
3export const isSearchBarAvailableForCurrentPlatform = [
4 'ios',
5 'android',
6].includes(Platform.OS);
7
8export function executeNativeBackPress() {
9 // This function invokes the native back press event
10 BackHandler.exitApp();
11 return true;
12}
13
14// Because of a bug introduced in https://github.com/software-mansion/react-native-screens/pull/1646
15// react-native-screens v3.21 changed how header's backTitle handles whitespace strings in https://github.com/software-mansion/react-native-screens/pull/1726
16// To allow for backwards compatibility in @react-navigation/native-stack we need a way to check if this version or newer is used.
17// See https://github.com/react-navigation/react-navigation/pull/11423 for more context.
18export const isNewBackTitleImplementation = true;