access view managers as Native Modules

Reviewed By: achen1

Differential Revision: D4338782

fbshipit-source-id: 1573e45ee3af5a44d033a166424e556b2c091fb6
This commit is contained in:
Aaron Chiu
2017-01-20 15:53:42 -08:00
committed by Facebook Github Bot
parent 577fd0cbb9
commit 5e9db574ee
16 changed files with 73 additions and 37 deletions

View File

@@ -101,7 +101,11 @@ if (Platform.OS === 'ios') {
}
});
} else if (Platform.OS === 'android' && UIManager.AndroidLazyViewManagersEnabled) {
// TODO fill this out
UIManager.ViewManagerNames.forEach(viewManagerName => {
defineLazyObjectProperty(UIManager, viewManagerName, {
get: () => NativeModules[viewManagerName.replace(/^(RCT|RK)/, '')],
});
});
}
module.exports = UIManager;