import { requireNativeComponent, UIManager } from 'react-native'; import { LINKING_ERROR } from '../constants/FWErrorMessage'; const NativeComponentName = 'FWVideoFeed'; // Use global cache to avoid duplicate registration declare global { var __FWVideoFeed: any; } if (!global.__FWVideoFeed) { global.__FWVideoFeed = UIManager.getViewManagerConfig(NativeComponentName) != null ? requireNativeComponent(NativeComponentName) : () => { throw new Error(LINKING_ERROR); }; } const FWVideoFeed = global.__FWVideoFeed; export default FWVideoFeed;