我是 RN 和 Expo 的菜鸟。我已经生成了新项目expo init test
,然后cd test
,然后npm install --save react-native-ble-plx
开始博览会npm start
。
在我的代码中,我添加了以下几行:
import { BleManager } from 'react-native-ble-plx';
export const manager = new BleManager();
manager.onStateChange(onStateChange);
当我尝试从 ios emulator/android 或 web 运行它时,我收到错误:
Native module cannot be null.
那么,是否可以像react-native-ble-plx
在 Expo 中一样运行原生模块?如果是,我做错了什么?