Skip to content

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

Open
@JediahDizon

Description

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions