react-native-sensor-manager
react-native-sensor-manager copied to clipboard
NativeModules Error
Error: Unable to resolve module NativeModules from ......../app: NativeModules could not be found within the project.
I am using
"react": "16.9.0",
"react-native": "0.61.5",
Use This code its working for me import {DeviceEventEmitter, NativeModules, } from 'react-native'; const mSensorManager = NativeModules.SensorManager; constructor() { super(); mSensorManager.startLightSensor(1000);
DeviceEventEmitter.addListener('LightSensor', function(data) {
console.log('Light === ', data);
});
}
Use This code its working for me import {DeviceEventEmitter, NativeModules, } from 'react-native'; const mSensorManager = NativeModules.SensorManager; constructor() { super(); mSensorManager.startLightSensor(1000);
DeviceEventEmitter.addListener('LightSensor', function(data) { console.log('Light === ', data); });}
THANKS!!!!!