HomePhabricator
Diffusion Comm bdef4a61a43a

[native] Fix `removeEventListener` deprecation warn

Description

[native] Fix removeEventListener deprecation warn

Summary:
In React Native 0.66, all removeEventListener() functions became deprecated in favor of subscription.remove() obtained by subscription = addEventListener().

Simulator Screen Shot - iPhone 14 Pro - 2022-10-17 at 08.25.56.png (2×1 px, 274 KB)

In our app lifecycle listener we have already been following the new pattern, by creating our own facade for the EventSubscription. It is now no longer needed, as we can return the React Native subscription object directly.

I'm going to need this interface in my height measurement stuff, so I'm fixing this ahead of time.

Test Plan:

  • Ran the native app and confirmed this warn doesn't show up anymore
  • Confirmed with debugger that listener subscription is removed properly

Reviewers: ashoat, tomek, atul

Reviewed By: ashoat, tomek, atul

Subscribers: atul, abosh

Differential Revision: https://phab.comm.dev/D5386

Details

Provenance
bartekAuthored on Oct 17 2022, 11:46 PM
Reviewer
ashoat
Differential Revision
D5386: [native] Fix `removeEventListener` deprecation warn
Parents
rCOMMd15b292342ee: Added tests for spoiler regex
Branches
Unknown
Tags
Unknown