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: Remove BackHandler.removeEventListener #45892

Closed

Conversation

retyui
Copy link
Contributor

@retyui retyui commented Aug 5, 2024

Summary:

All removeEventListener methods was removed 2596b2f perviously but seems a BackHandler was missed

This can be a breaking change for some third-party modules.

Migration: Use remove on the EventSubscription from addEventListener:

useEffect(() => {
+  const subscription = NativeModule.removeListener(name, listener);
+  return () => subscription.remove();
}, []);

Changelog:

[GENERAL] [REMOVED] - Remove BackHandler.removeEventListener

Test Plan:

...

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Callstack Partner: Callstack Partner Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. labels Aug 5, 2024
@retyui retyui force-pushed the chore/retyui/-remove-removeEventListener branch from bee2a0e to 069b3fd Compare August 7, 2024 14:30
@facebook-github-bot
Copy link
Contributor

@javache has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Nov 10, 2024
@facebook-github-bot
Copy link
Contributor

@javache merged this pull request in 44d6194.

@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @retyui in 44d6194

When will my fix make it into a release? | How to file a pick request?

klxiaoniu added a commit to west2-online/fzuhelper-app that referenced this pull request Feb 1, 2025
klxiaoniu added a commit to west2-online/fzuhelper-app that referenced this pull request Feb 1, 2025
jankosecki added a commit to jankosecki/hooks that referenced this pull request Feb 3, 2025
RN 0.77.0 contains a PR removing `removeEventListener` from `BackHandler` (facebook/react-native#45892)

This PR uses suggested migration of using `remove` on `EventSubscription`
jankosecki added a commit to jankosecki/hooks that referenced this pull request Feb 3, 2025
RN 0.77.0 contains a PR removing `removeEventListener` from `BackHandler` (facebook/react-native#45892)

This PR uses suggested migration of using `remove` on `EventSubscription`
@retyui retyui deleted the chore/retyui/-remove-removeEventListener branch February 3, 2025 13:41
retyui added a commit to retyui/react-native-website that referenced this pull request Feb 3, 2025
pvinis pushed a commit to react-native-community/hooks that referenced this pull request Feb 7, 2025
RN 0.77.0 contains a PR removing `removeEventListener` from `BackHandler` (facebook/react-native#45892)

This PR uses suggested migration of using `remove` on `EventSubscription`
darshan09200 added a commit to vetster/react-native-action-sheet that referenced this pull request Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. p: Callstack Partner: Callstack Partner Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants