Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/05xxx/module_5014.js (118.4 MB)
43 lines
1.6 KiB
TypeScript
43 lines
1.6 KiB
TypeScript
// Module ID: 5265
|
|
// Function ID: 5266
|
|
// Name: requireNativeComponentOrDefault
|
|
// Dependencies: [17, 3, 2]
|
|
// Exports: default
|
|
|
|
// Module 5265 (requireNativeComponentOrDefault)
|
|
import LoggerDefault from "Logger" /* 3 */;
|
|
import get_ActivityIndicator from "module_17" /* 17 */;
|
|
import size from "module_2" /* 2 */;
|
|
|
|
({ requireNativeComponent: closure_0, UIManager: closure_1, View: c2 } = get_ActivityIndicator);
|
|
const logger = new LoggerDefault("RequireNativeComponentOrDefault");
|
|
const map = new Map();
|
|
let result = size.fileFinishedImporting("utils/native/requireNativeComponentOrDefault.native.tsx");
|
|
|
|
export default function requireNativeComponentOrDefault(warnWhenMissing) {
|
|
({ componentName, componentFoundInstance, componentMissingFallbackInstance } = warnWhenMissing);
|
|
if (componentMissingFallbackInstance === undefined) {
|
|
componentMissingFallbackInstance = React2;
|
|
}
|
|
let flag = warnWhenMissing.warnWhenMissing;
|
|
if (flag === undefined) {
|
|
flag = true;
|
|
}
|
|
if (framebus.hasViewManagerConfig(componentName)) {
|
|
if (!map.has(componentName)) {
|
|
if (componentFoundInstance == null) {
|
|
componentFoundInstance = React(componentName);
|
|
}
|
|
const result = obj.set(componentName, componentFoundInstance);
|
|
}
|
|
value = obj.get(componentName);
|
|
} else {
|
|
value = componentMissingFallbackInstance;
|
|
if (flag) {
|
|
const _HermesInternal = HermesInternal;
|
|
logger.warn("" + componentName + " not found, you are likely on a branch override without the native code.");
|
|
value = componentMissingFallbackInstance;
|
|
}
|
|
}
|
|
return value;
|
|
};
|