From f2e9ec82c501547c6f73248e38a47ea191e2708b Mon Sep 17 00:00:00 2001 From: Kilian Finger Date: Wed, 27 Nov 2024 09:31:32 +0100 Subject: [PATCH] refactor: remove getIOSModuleName --- src/utils/index.ts | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/src/utils/index.ts b/src/utils/index.ts index 902b82bf0..6352dcbcd 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -8,14 +8,6 @@ import { UIManager, } from "react-native"; -function getAndroidManagerInstance(module: string) { - return UIManager.getViewManagerConfig(module); -} - -function getIosManagerInstance(module: string): any { - return NativeModules[getIOSModuleName(module)]; -} - export function isAndroid(): boolean { return Platform.OS === "android"; } @@ -73,8 +65,8 @@ export function runNativeCommand( } const managerInstance = isAndroid() - ? getAndroidManagerInstance(module) - : getIosManagerInstance(module); + ? UIManager.getViewManagerConfig(module) + : NativeModules[module]; if (!managerInstance) { throw new Error(`Could not find ${module}`); @@ -121,14 +113,6 @@ export function resolveImagePath(imageRef: ImageSourcePropType): string { return res.uri; } -export function getIOSModuleName(moduleName: string): string { - if (moduleName.startsWith("RCT")) { - return moduleName.substring(3); - } - - return moduleName; -} - export function toJSONString(json: object | string = ""): string { return JSON.stringify(json); }