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

44 lines
1.6 KiB
TypeScript
Raw Normal View History

// Module ID: 5264
// Function ID: 5265
// Name: requireNativeComponentOrDefault
2026-07-29 08:29:29 +00:00
// Dependencies: [17, 3, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
// Module 5264 (requireNativeComponentOrDefault)
import LoggerDefault from "Logger" /* 3 */;
import get_ActivityIndicator from "module_17" /* 17 */;
import size from "module_2" /* 2 */;
2026-07-23 10:11:24 +00:00
({ requireNativeComponent: closure_0, UIManager: closure_1, View: c2 } = get_ActivityIndicator);
const logger = new LoggerDefault("RequireNativeComponentOrDefault");
2026-07-20 16:05:17 +00:00
const map = new Map();
let result = size.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 = React2;
2026-07-20 16:05:17 +00:00
}
let flag = warnWhenMissing.warnWhenMissing;
if (flag === undefined) {
flag = true;
}
if (framebus.hasViewManagerConfig(componentName)) {
2026-07-20 16:05:17 +00:00
if (!map.has(componentName)) {
2026-07-29 08:29:29 +00:00
if (componentFoundInstance == null) {
componentFoundInstance = React(componentName);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const result = obj.set(componentName, componentFoundInstance);
2026-07-20 16:05:17 +00:00
}
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;
};