From 7fd13cacfea4e9e4609ac2cfa11749544fc2f8f8 Mon Sep 17 00:00:00 2001 From: Hailey Date: Wed, 28 Feb 2024 15:38:54 -0800 Subject: [PATCH] Remove `Platform.select()` (#3027) --- src/alf/util/platform.ts | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/alf/util/platform.ts b/src/alf/util/platform.ts index 544f5480..294e08a8 100644 --- a/src/alf/util/platform.ts +++ b/src/alf/util/platform.ts @@ -1,25 +1,25 @@ -import {Platform} from 'react-native' +import {isAndroid, isIOS, isNative, isWeb} from 'platform/detection' export function web(value: any) { - return Platform.select({ - web: value, - }) + if (isWeb) { + return value + } } export function ios(value: any) { - return Platform.select({ - ios: value, - }) + if (isIOS) { + return value + } } export function android(value: any) { - return Platform.select({ - android: value, - }) + if (isAndroid) { + return value + } } export function native(value: any) { - return Platform.select({ - native: value, - }) + if (isNative) { + return value + } }