Page MenuHomePhabricator

[native] Fix `removeEventListener` deprecation warn
ClosedPublic

Authored by bartek on Oct 18 2022, 12:10 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 2, 8:40 PM
Unknown Object (File)
Sat, Oct 19, 8:24 AM
Unknown Object (File)
Fri, Oct 18, 9:03 PM
Unknown Object (File)
Oct 6 2024, 9:03 PM
Unknown Object (File)
Oct 6 2024, 9:03 PM
Unknown Object (File)
Sep 10 2024, 1:56 PM
Unknown Object (File)
Sep 8 2024, 10:35 PM
Unknown Object (File)
Sep 7 2024, 2:49 AM
Subscribers

Details

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

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable