react-native-dom-expo
Version:
A patch library to make Expo work with react-native-dom
28 lines (22 loc) • 636 B
JavaScript
import {
Platform as ReactNativePlatform,
NativeModules,
requireNativeComponent,
} from 'react-native';
import { EventEmitter, Subscription } from '../expo-react-native-adapter/build/EventEmitter';
export const Platform = {
OS: ReactNativePlatform.OS,
};
const NativeModulesProxy = {};
Object.keys(NativeModules).forEach((moduleName) => {
if (moduleName.startsWith('Expo')) {
NativeModulesProxy[moduleName] = NativeModules[moduleName];
}
});
const requireNativeViewManager = viewName => requireNativeComponent(viewName);
export {
EventEmitter,
Subscription,
NativeModulesProxy,
requireNativeViewManager,
};