mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Improvement to lazy view config loading
Summary: While adding support for this to React VR I noticed that `viewConfig.Manager` was `undefined` which meant that the view config never get assigned to the `viewManagerConfigs` object and caused errors later on. This change makes it so that even if `viewConfig.Manager` is not set the viewConfig still gets added to the `viewManagerConfigs` object. Reviewed By: rickhanlonii Differential Revision: D16560992 fbshipit-source-id: 626dc133602b142caff60f41d043d02968e6ccfc
This commit is contained in:
committed by
Facebook Github Bot
parent
2dadb9e2b0
commit
d8f1161c8a
@@ -86,8 +86,8 @@ NativeUIManager.getViewManagerConfig = UIManagerJS.getViewManagerConfig;
|
||||
|
||||
function lazifyViewManagerConfig(viewName) {
|
||||
const viewConfig = getConstants()[viewName];
|
||||
viewManagerConfigs[viewName] = viewConfig;
|
||||
if (viewConfig.Manager) {
|
||||
viewManagerConfigs[viewName] = viewConfig;
|
||||
defineLazyObjectProperty(viewConfig, 'Constants', {
|
||||
get: () => {
|
||||
const viewManager = NativeModules[viewConfig.Manager];
|
||||
|
||||
Reference in New Issue
Block a user