1 | import { Platform, NativeModules } from './react-native';
|
2 |
|
3 | const NativeIconAPI =
|
4 | NativeModules.RNVectorIconsManager || NativeModules.RNVectorIconsModule;
|
5 |
|
6 | export default function ensureNativeModuleAvailable() {
|
7 | if (!NativeIconAPI) {
|
8 | if (Platform.OS === 'android') {
|
9 | throw new Error(
|
10 | 'RNVectorIconsModule not available, did you properly integrate the module? Try running `react-native link react-native-vector-icons` and recompiling.'
|
11 | );
|
12 | }
|
13 | throw new Error(
|
14 | 'RNVectorIconsManager not available, did you add the library to your project and link with libRNVectorIcons.a? Try running `react-native link react-native-vector-icons` and recompiling.'
|
15 | );
|
16 | }
|
17 | }
|