mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Refactor UIManagerHelper.getUIManager to return null when there's no UIManager registered
Summary: This diff refactors the UIManagerHelper.getUIManager method to return null when there's no UIManager registered for the uiManagerType received as a parameter. This is necessary to workaround: https://github.com/facebook/react-native/issues/31245 changelog: [changed] UIManagerHelper.getUIManager now returns null when there's no UIManager registered for the uiManagerType received as a parameter Reviewed By: fkgozali Differential Revision: D28242592 fbshipit-source-id: c3a4979bcf6e547d0f0060737e41bbf19860a984
This commit is contained in:
committed by
Lorenzo Sciandra
parent
a05d179b6a
commit
d894163662
@@ -86,9 +86,18 @@ public class UIManagerHelper {
|
||||
}
|
||||
}
|
||||
CatalystInstance catalystInstance = context.getCatalystInstance();
|
||||
return uiManagerType == FABRIC
|
||||
? (UIManager) catalystInstance.getJSIModule(JSIModuleType.UIManager)
|
||||
: catalystInstance.getNativeModule(UIManagerModule.class);
|
||||
try {
|
||||
return uiManagerType == FABRIC
|
||||
? (UIManager) catalystInstance.getJSIModule(JSIModuleType.UIManager)
|
||||
: catalystInstance.getNativeModule(UIManagerModule.class);
|
||||
} catch (IllegalArgumentException ex) {
|
||||
// TODO T67518514 Clean this up once we migrate everything over to bridgeless mode
|
||||
ReactSoftException.logSoftException(
|
||||
"UIManagerHelper",
|
||||
new ReactNoCrashSoftException(
|
||||
"Cannot get UIManager for UIManagerType: " + uiManagerType));
|
||||
return catalystInstance.getNativeModule(UIManagerModule.class);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user