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

Orientation listener callback gets called multiple times despite stopping right after the first update #40

Open
JediahDizon opened this issue Jul 9, 2018 · 0 comments

Comments

@JediahDizon
Copy link

JediahDizon commented Jul 9, 2018

componentDidMount() {
	SensorManager.startOrientation(5000); // Minimum delay does not work :(
	DeviceEventEmitter.addListener("Orientation", orientation => {
		SensorManager.stopOrientation();
		alert(JSON.stringify(orientation));
	});
}

This causes my component to popup an alert over 15 times before actually stopping. Is there anything I could do to only render once? Any help would be much appreciated! Thank you in advanced!

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

1 participant