Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NativeModules Error #47

Open
uendar opened this issue Mar 10, 2020 · 2 comments
Open

NativeModules Error #47

uendar opened this issue Mar 10, 2020 · 2 comments

Comments

@uendar
Copy link

uendar commented Mar 10, 2020

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",
@arbabr96
Copy link

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);
});

}

@williamniemiec
Copy link

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!!!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants