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

Remove deprecated removeEventListener() calls #297

Merged
merged 2 commits into from Apr 7, 2022
Merged

Remove deprecated removeEventListener() calls #297

merged 2 commits into from Apr 7, 2022

Conversation

TheWirv
Copy link
Contributor

@TheWirv TheWirv commented Aug 24, 2021

PR Checklist

What is the current behavior?

For React Native's Linking and AppState APIs, the deprecated removeEventListener() calls had been used before.

What is the new behavior?

Both Linking.addEventListener() and AppState.addEventListener() return an event subscription object containing a corresponding remove() method. They are being used in utils.js now.

Fixes/Implements/Closes #296.
No breaking changes

@jdnichollsc I am a TypeScript person and have never worked with flow before. Please check the flow types whether they are still correct.

@jdnichollsc
Copy link
Member

Thanks for your contribution mate, please let me check this ASAP! <3

@radko93
Copy link

radko93 commented Oct 12, 2021

@jdnichollsc would it be possible to merge that? Please not this is a breaking change for older RN versions.

@jdnichollsc
Copy link
Member

Hello folks, thanks for this awesome contribution, do you know if this works for previous versions of RN?

Thanks for your help!

@radko93
Copy link

radko93 commented Oct 14, 2021

@jdnichollsc This PR is not backwards compatible (at least not all the way to older versions), but it is possible. I've made a similar PR recently https://github.com/AgoraIO-Community/react-native-agora/pull/414/files

@TheWirv
Copy link
Contributor Author

TheWirv commented Oct 14, 2021

@radko93 @jdnichollsc Hey guys, please check out the PR's current state after my newest commit. This should make it backwards-compatible, I think.

@mr-rick
Copy link

mr-rick commented Nov 17, 2021

I have tested your latest commit and I'm getting these errors...

I/ViewRootImpl@97b629a[MainActivity]: ViewPostIme pointer 0
I/ViewRootImpl@97b629a[MainActivity]: ViewPostIme pointer 1
I/ViewRootImpl@97b629a[MainActivity]: ViewPostIme pointer 0
I/ViewRootImpl@97b629a[MainActivity]: ViewPostIme pointer 1
I/ViewRootImpl@97b629a[MainActivity]: ViewPostIme pointer 0
I/ViewRootImpl@97b629a[MainActivity]: ViewPostIme pointer 1
I/ViewRootImpl@97b629a[MainActivity]: ViewPostIme pointer 0
I/ViewRootImpl@97b629a[MainActivity]: ViewPostIme pointer 1```

A quick google search says..... "The reason is because you miss to set listener to your button."

btn.setOnClickListener(this);

I'm on react native 66.3

@jdnichollsc
Copy link
Member

@TheWirv hey mate, do you have any idea about those warnings? 🔝

@TheWirv
Copy link
Contributor Author

TheWirv commented Mar 3, 2022

No, absolutely not, sorry. :/

@jdnichollsc
Copy link
Member

No problem, let me try and thanks for your help mate! <3

@ajaxjiang96
Copy link

Is their a release plan for this patch?

@jdnichollsc
Copy link
Member

jdnichollsc commented Jul 29, 2022

I'm creating a new Release 3.7.0, stay tuned! <3

@jdnichollsc jdnichollsc mentioned this pull request Jul 29, 2022
@LonelyCpp LonelyCpp mentioned this pull request Mar 30, 2023
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.

RN v0.65: Warnings pertaining deprecated usage of event listeners
5 participants