mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-24 04:16:00 +08:00
Prettier React Native Libraries
Reviewed By: sahrens Differential Revision: D7961488 fbshipit-source-id: 05f9b8b0b91ae77f9040a5321ccc18f7c3c1ce9a
This commit is contained in:
committed by
Facebook Github Bot
parent
1e2de71290
commit
d01ab66b47
@@ -81,14 +81,21 @@ if (Platform.OS === 'ios') {
|
||||
// However, the way things are set up, the list of view managers is not known at compile time.
|
||||
// As Prepack runs at compile it, it cannot process this loop.
|
||||
// So we wrap it in a special __residual call, which basically tells Prepack to ignore it.
|
||||
let residual = global.__residual ? global.__residual : (_, f, ...args) => f.apply(undefined, args);
|
||||
residual("void", (UIManager, defineLazyObjectProperty) => {
|
||||
UIManager.ViewManagerNames.forEach(viewManagerName => {
|
||||
defineLazyObjectProperty(UIManager, viewManagerName, {
|
||||
get: () => UIManager.getConstantsForViewManager(viewManagerName),
|
||||
let residual = global.__residual
|
||||
? global.__residual
|
||||
: (_, f, ...args) => f.apply(undefined, args);
|
||||
residual(
|
||||
'void',
|
||||
(UIManager, defineLazyObjectProperty) => {
|
||||
UIManager.ViewManagerNames.forEach(viewManagerName => {
|
||||
defineLazyObjectProperty(UIManager, viewManagerName, {
|
||||
get: () => UIManager.getConstantsForViewManager(viewManagerName),
|
||||
});
|
||||
});
|
||||
});
|
||||
}, UIManager, defineLazyObjectProperty);
|
||||
},
|
||||
UIManager,
|
||||
defineLazyObjectProperty,
|
||||
);
|
||||
|
||||
// As Prepack now no longer knows which properties exactly the UIManager has,
|
||||
// we also tell Prepack that it has only partial knowledge of the UIManager,
|
||||
|
||||
Reference in New Issue
Block a user