MCPcopy Create free account
hub / github.com/expo/expo / requireNativeModule

Function requireNativeModule

packages/expo-modules-core/src/requireNativeModule.ts:16–23  ·  view source on GitHub ↗
(moduleName: string)

Source from the content-addressed store, hash-verified

14 * @throws Error when there is no native module with given name.
15 */
16export function requireNativeModule<ModuleType = any>(moduleName: string): ModuleType {
17 const nativeModule = requireOptionalNativeModule<ModuleType>(moduleName);
18
19 if (!nativeModule) {
20 throw new Error(`Cannot find native module '${moduleName}'`);
21 }
22 return nativeModule;
23}
24
25/**
26 * Imports the native module registered with the given name. The same as `requireNativeModule`,

Callers 15

PlatformUtils.tsFile · 0.90
ExpoAsset.tsFile · 0.90
ExpoLinking.tsFile · 0.90
ExpoMaps.tsFile · 0.90
requireNativeViewManagerFunction · 0.90
ExpoKeepAwake.tsFile · 0.90
EASClient.tsFile · 0.90
ExpoGo.tsFile · 0.90
ExpoFetchModule.tsFile · 0.90
ExpoFontLoader.tsFile · 0.90

Calls 1

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…