fix: Use global.expo.modules for JSI expo modules

This commit is contained in:
Marc Rousavy 2023-03-15 09:34:15 -04:00
parent 0d83a13196
commit a1af891879

View File

@ -21,8 +21,9 @@ if (CameraModule == null) {
if (Platform.OS === 'android') message += '\n* Make sure gradle is synced.';
// check if Expo
// @ts-expect-error expo global JSI modules are not typed
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
const ExpoConstants = NativeModules.NativeUnimoduleProxy?.modulesConstants?.ExponentConstants;
const ExpoConstants = global.expo?.modules?.ExponentConstants;
if (ExpoConstants != null) {
if (ExpoConstants.appOwnership === 'expo') {
// We're running Expo Go