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:
Martin Sherburn
2019-07-31 05:40:49 -07:00
committed by Facebook Github Bot
parent 2dadb9e2b0
commit d8f1161c8a
+1 -1
View File
@@ -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];