mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Explicitly make UIManagerModule use OnBatchComplete on Android
Summary: Currently, we scan all native modules to see if they implement the OnBatchCompleteListerner. If they do, we add those modules to a list, and when C++ calls OnBactchComplete is called, we execute the callback on each of the modules. The only native module implementing this callback today is the UIManagerModule. With Fabric, UIManager will also not be a native module anymore. This diff removes all the work done for creating the list and assumes that UIManagerModule is the only place that is interested in OnBatchComplete call - and calls it directly. Reviewed By: achen1 Differential Revision: D9186651 fbshipit-source-id: 473586b37c2465ccd041985dcdd56132026f34f1
This commit is contained in:
committed by
Facebook Github Bot
parent
69912495f9
commit
617e25d9b5
@@ -122,14 +122,7 @@ public class NativeModuleRegistryBuilder {
|
||||
}
|
||||
|
||||
public NativeModuleRegistry build() {
|
||||
ArrayList<ModuleHolder> batchCompleteListenerModules = new ArrayList<>();
|
||||
for (Map.Entry<String, ModuleHolder> entry : mModules.entrySet()) {
|
||||
if (entry.getValue().hasOnBatchCompleteListener()) {
|
||||
batchCompleteListenerModules.add(entry.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
return new NativeModuleRegistry(
|
||||
mReactApplicationContext, mModules, batchCompleteListenerModules);
|
||||
mReactApplicationContext, mModules);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user