fix(lib/modules/metro): skip nativeModuleProxy existence check for bad exports check

This commit is contained in:
PalmDevs 2025-04-06 00:15:20 +07:00
parent c5caa63cef
commit deb57ebe0a
No known key found for this signature in database
GPG key ID: 6FAE8F8677ACA8BA

View file

@ -104,7 +104,7 @@ export function _isExportsBad(exports: Metro.ModuleExports) {
exports === null ||
// Can't run isProxy() on this because this isn't your typical proxy:
// https://github.com/discord/react-native/blob/master/packages/react-native/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleBinding.cpp
(globalThis.nativeModuleProxy && exports === nativeModuleProxy) ||
exports === nativeModuleProxy ||
// Checking if the object is empty
(exports.__proto__ === Object.prototype && !Reflect.ownKeys(exports).length)
)