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

[RN 0.25.1] _reactNative.DeviceEventEmitter.removeListener is not a function #16811

Closed
12343954 opened this issue Nov 13, 2017 · 1 comment
Closed
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@12343954
Copy link

12343954 commented Nov 13, 2017

Is this a bug report?

Yes

Have you read the Contributing Guidelines?

Yes

Environment

Environment:
OS: macOS Sierra 10.12.6
Node: v8.2.1
Yarn: NO
npm: 5.5.1
Watchman: 4.9.0
Xcode: Version 8.3.3 (8E3004b)
Android Studio: NO

Packages: (wanted => installed)
react-native: 0.25.1
react: ^0.14.9

Target Platform: iOS (10.3)

Steps to Reproduce

(Write your steps here:)

componentDidMount() { //Alert.alert('xx',this.state.user.FName+' ') this.watchID = navigator.geolocation.watchPosition((position) => { var lastPosition = JSON.stringify(position); this.setState({ lastPosition }); }); console.log('this.watchID') console.log(this.watchID) }

**componentWillUnmount() { // here is the bug** navigator.geolocation.clearWatch(this.watchID); }

  1. when unmount , appear this error
    _reactNative.DeviceEventEmitter.removeListener is not a function

Expected Behavior

I don't want upgrade RN to other version,because it will occur lots of error,that's too bad!

(Write what you thought would happen.)

I do catch error,but can't catch the error

componentWillUnmount() {
		try {
			navigator.geolocation.clearWatch(this.watchID);
			debugger;
		} catch (error) {
			console.log(error)
		}
		// debugger;
	}

(Write what happened. Add screenshots!)
image

Reproducible Demo

(Paste the link to an example project and exact instructions to reproduce the issue.)

@hramos
Copy link
Contributor

hramos commented Nov 13, 2017

Hey! 0.25.1 is quite old at this point. Please try a newer version and submit a new issue if needed.

@hramos hramos closed this as completed Nov 13, 2017
@facebook facebook locked as resolved and limited conversation to collaborators Nov 13, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Nov 13, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

3 participants