如何在 React Native Expo 中使用第三方库
How to use 3rd party library in react native expo
我是 RN 和 Expo 的菜鸟。我生成了新项目 expo init test
,然后是 cd test
,然后是 npm install --save react-native-ble-plx
,并在 npm start
开始了 expo。
在我的代码中,我添加了以下几行:
import { BleManager } from 'react-native-ble-plx';
export const manager = new BleManager();
manager.onStateChange(onStateChange);
当我尝试从 ios emulator/android 或网络 运行 时,我收到错误消息:
Native module cannot be null.
那么,是否可以在 Expo 中 运行 像 react-native-ble-plx
这样的原生模块?如果是,我做错了什么?
我是 RN 和 Expo 的菜鸟。我生成了新项目 expo init test
,然后是 cd test
,然后是 npm install --save react-native-ble-plx
,并在 npm start
开始了 expo。
在我的代码中,我添加了以下几行:
import { BleManager } from 'react-native-ble-plx';
export const manager = new BleManager();
manager.onStateChange(onStateChange);
当我尝试从 ios emulator/android 或网络 运行 时,我收到错误消息:
Native module cannot be null.
那么,是否可以在 Expo 中 运行 像 react-native-ble-plx
这样的原生模块?如果是,我做错了什么?