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: Warning on RN 65. agent.js #411

Closed
wants to merge 1 commit into from
Closed

Conversation

ripupo88
Copy link

Fix: Warning on RN 65 #410

React Native version:
"react-native": "0.65.1",
Warn:
WARN EventEmitter.removeListener('url', ...): Method has been deprecated. Please instead use remove() on the subscription returned by EventEmitter.addListener.

Changes

add variable to store the Event
let eventURL;

set variable with the new event
eventURL = Linking.addEventListener('url', urlHandler);

use event.remove() method instead of EventEmitter.removeListener('type',...)
eventURL.remove();

References

React Native Docs

Please note any links that are not publicly accessible.

Testing

Please describe how this can be tested by reviewers. Be specific about anything not tested and reasons why. If this library has unit and/or integration testing, tests should be added for new functionality and existing tests should complete without errors.

  • This change adds unit test coverage
  • This change has been tested on the latest version of the platform/language or why not

Checklist

Fix: Warning on RN 65

React Native version:
     "react-native": "0.65.1",
Warn:
      WARN  EventEmitter.removeListener('url', ...): Method has been deprecated. Please instead use `remove()` on the subscription returned by `EventEmitter.addListener`.

Reference:
     https://reactnative.dev/docs/linking#removeeventlistener

Changes:
//add variable to store the Event
      let eventURL;

//set variable with the new event
      eventURL = Linking.addEventListener('url', urlHandler);

//use event.remove() method instead of EventEmitter.removeListener('type',...)
       eventURL.remove();
Copy link
Contributor

@lbalmaceda lbalmaceda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the change! It looks correct according to what's documented, but the tests are failing. Can you check those, please?

@lbalmaceda lbalmaceda added this to the vNext milestone Sep 28, 2021
@lbalmaceda lbalmaceda added the waiting for customer This issue is waiting for a response from the issue or PR author label Sep 28, 2021
@poovamraj
Copy link
Contributor

Hey @ripupo88, we have fixed this issue here #441. So closing this PR, do let us know if there is anything else we can do for you :) Happy 2022

@poovamraj poovamraj closed this Jan 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CH: Fixed waiting for customer This issue is waiting for a response from the issue or PR author
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Warning for deprecated method "removeEventListener()" with "react-native" "0.65.1"
3 participants