From d8f1161c8a55d346c4f03efc64e79ca7fdb1423e Mon Sep 17 00:00:00 2001 From: Martin Sherburn Date: Wed, 31 Jul 2019 05:33:23 -0700 Subject: [PATCH] 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 --- Libraries/ReactNative/PaperUIManager.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/ReactNative/PaperUIManager.js b/Libraries/ReactNative/PaperUIManager.js index d50a006c9ed..5e80795ec29 100644 --- a/Libraries/ReactNative/PaperUIManager.js +++ b/Libraries/ReactNative/PaperUIManager.js @@ -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];