mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-04 09:27:53 +08:00
Make ReactModuleInfoProvider use string keys
Summary: `ReactModuleInfoProvider` was using `Class` as the keys. This would make the classes to load. This change makes the map use canonicalName Strings of the classes, removing the need for the classes to load at this point. Reviewed By: achen1 Differential Revision: D8944078 fbshipit-source-id: 4aa562d74d6ad3ebb9962b581d4e2f5e89d47ca6
This commit is contained in:
committed by
Facebook Github Bot
parent
9176fc00b5
commit
d891ee1dee
@@ -49,12 +49,12 @@ public class NativeModuleRegistryBuilder {
|
||||
if (reactPackage instanceof LazyReactPackage) {
|
||||
LazyReactPackage lazyReactPackage = (LazyReactPackage) reactPackage;
|
||||
List<ModuleSpec> moduleSpecs = lazyReactPackage.getNativeModules(mReactApplicationContext);
|
||||
Map<Class, ReactModuleInfo> reactModuleInfoMap = lazyReactPackage.getReactModuleInfoProvider()
|
||||
.getReactModuleInfos();
|
||||
Map<String, ReactModuleInfo> reactModuleInfoMap =
|
||||
lazyReactPackage.getReactModuleInfoProvider().getReactModuleInfos();
|
||||
|
||||
for (ModuleSpec moduleSpec : moduleSpecs) {
|
||||
Class<? extends NativeModule> type = moduleSpec.getType();
|
||||
ReactModuleInfo reactModuleInfo = reactModuleInfoMap.get(type);
|
||||
ReactModuleInfo reactModuleInfo = reactModuleInfoMap.get(type.getCanonicalName());
|
||||
ModuleHolder moduleHolder;
|
||||
if (reactModuleInfo == null) {
|
||||
if (BaseJavaModule.class.isAssignableFrom(type)) {
|
||||
|
||||
Reference in New Issue
Block a user