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

useEffect returning promises. #2269

Closed
abhi3315 opened this issue Feb 7, 2023 · 1 comment
Closed

useEffect returning promises. #2269

abhi3315 opened this issue Feb 7, 2023 · 1 comment

Comments

@abhi3315
Copy link

abhi3315 commented Feb 7, 2023

Is your feature request related to a problem? Please describe.
I was working on the Newspack plugin and come to know that there are a few useEffect hooks which are returning promises.
It's best practice to either return nothing or a clean-up function.
There are a few warnings too in the console.

image

image

Describe the solution you'd like
This is a simple improvement. I would like to contribute to this.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

@miguelpeixe
Copy link
Member

Thank you for reporting, @abhi3315

I believe we have tackled all the instances with incorrect useEffect usage. Please, feel free to reopen if another one is identified.

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

No branches or pull requests

2 participants