decord/source/utils/native/requireNativeComponentOrDefault.native.tsx

45 lines
1.6 KiB
TypeScript
Raw Normal View History

2026-08-25 06:04:03 +00:00
// Module ID: 4808
// Function ID: 4809
2026-07-20 16:05:17 +00:00
// Name: map
2026-07-29 08:29:29 +00:00
// Dependencies: [17, 3, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-25 06:04:03 +00:00
// Module 4808 (map)
2026-08-24 06:08:38 +00:00
import set from "set" /* 2 */;
import timestampDefault from "timestamp" /* 3 */;
import get_ActivityIndicator from "get ActivityIndicator" /* 17 */;
2026-07-23 10:11:24 +00:00
2026-07-29 08:29:29 +00:00
({ requireNativeComponent: c0, UIManager: closure_1, View: obj1 } = get_ActivityIndicator);
2026-08-24 06:08:38 +00:00
let closure_3 = new timestampDefault("RequireNativeComponentOrDefault");
2026-07-20 16:05:17 +00:00
const map = new Map();
2026-08-24 06:08:38 +00:00
const tmp3 = new timestampDefault("RequireNativeComponentOrDefault");
let result = set.fileFinishedImporting("utils/native/requireNativeComponentOrDefault.native.tsx");
2026-07-20 16:05:17 +00:00
export default function requireNativeComponentOrDefault(warnWhenMissing) {
({ componentName, componentFoundInstance, componentMissingFallbackInstance } = warnWhenMissing);
if (componentMissingFallbackInstance === undefined) {
componentMissingFallbackInstance = closure_2;
}
let flag = warnWhenMissing.warnWhenMissing;
if (flag === undefined) {
flag = true;
}
if (closure_1.hasViewManagerConfig(componentName)) {
if (!map.has(componentName)) {
2026-07-29 08:29:29 +00:00
if (componentFoundInstance == null) {
2026-07-20 16:05:17 +00:00
componentFoundInstance = callback(componentName);
}
2026-07-29 08:29:29 +00:00
const result = obj.set(componentName, componentFoundInstance);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let value = obj.get(componentName);
2026-07-20 16:05:17 +00:00
} else {
value = componentMissingFallbackInstance;
if (flag) {
const _HermesInternal = HermesInternal;
2026-08-24 06:08:38 +00:00
logger.warn("" + componentName + " not found, you are likely on a branch override without the native code.");
2026-07-20 16:05:17 +00:00
value = componentMissingFallbackInstance;
}
}
return value;
};