react-nativereact-native-native-module

How to use 3rd party library in react native expo


Im total noob in RN and Expo. I'v generated new project expo init test, then cd test, then npm install --save react-native-ble-plx and started expo by npm start.
In my code I added following lines:

import { BleManager } from 'react-native-ble-plx';
export const manager = new BleManager();
manager.onStateChange(onStateChange);

When Im trying to run it from ios emulator/android or web Im getting error:

Native module cannot be null.

So, is it possible to run native module like react-native-ble-plx in Expo? If yes what am I doing wrong?


Solution

  • You need to eject your expo project to be able to use this library.

    Source