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

Fix actually remove openURL event listener #2235

Merged
merged 3 commits into from
Sep 9, 2017

Conversation

joeybaker
Copy link

Previously, we were creating an anonymous function as the event listener handler. This means we can't un-listen because we don't have a reference to the handler.

Previously, we were creating an anonymous function as the event listener handler. This means we can't un-listen because we don't have a reference to the handler.
@vonovak
Copy link
Member

vonovak commented Aug 29, 2017

@matthamil can we get this merged?

ad additional description: the important part that got removed is:

Linking.addEventListener('url', ({ url }: { url: string }) => {
    this._handleOpenURL(url);
});

^ the function passed to addEventListener is anonymous.
however, Linking.removeEventListener('url', this._handleOpenURL); is called here which of course doesn't work, because this._handleOpenURL never got registered in the first place!

@vonovak
Copy link
Member

vonovak commented Aug 31, 2017

@spencercarli in an effort to decrease the number of open PRs, I'd like to draw attention to the fact that this PR can be merged

@vonovak
Copy link
Member

vonovak commented Sep 5, 2017

@charpeni I remeber reading somewhere that you have push access to this repo. Can you please take a look at this? thanks

@spencercarli
Copy link
Member

Thanks @joeybaker!

@spencercarli spencercarli self-assigned this Sep 9, 2017
@spencercarli spencercarli merged commit 70785d6 into react-navigation:master Sep 9, 2017
@joeybaker joeybaker deleted the patch-1 branch September 9, 2017 20:29
sourcecode911 pushed a commit to sourcecode911/react-navigation that referenced this pull request Mar 9, 2020
Previously, we were creating an anonymous function as the event listener handler. This means we can't un-listen because we don't have a reference to the handler.
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

Successfully merging this pull request may close these issues.

3 participants