mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-23 11:57:46 +08:00
Implement lazy discovery for ViewManagers.
Reviewed By: kathryngray Differential Revision: D5865095 fbshipit-source-id: c94970e4cd7aafb20cf844c48feea053ac8b6b0f
This commit is contained in:
committed by
Facebook Github Bot
parent
c4f7ce9afd
commit
da30b04703
@@ -79,13 +79,10 @@ if (Platform.OS === 'ios') {
|
||||
});
|
||||
}
|
||||
});
|
||||
} else if (
|
||||
Platform.OS === 'android' &&
|
||||
UIManager.AndroidLazyViewManagersEnabled
|
||||
) {
|
||||
} else if (Platform.OS === 'android' && UIManager.ViewManagerNames) {
|
||||
UIManager.ViewManagerNames.forEach(viewManagerName => {
|
||||
defineLazyObjectProperty(UIManager, viewManagerName, {
|
||||
get: () => NativeModules[viewManagerName.replace(/^(RCT|RK)/, '')],
|
||||
get: () => UIManager.getConstantsForViewManager(viewManagerName),
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user