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

Fill component throws state update warning #28478

Closed
glendaviesnz opened this issue Jan 25, 2021 · 4 comments
Closed

Fill component throws state update warning #28478

glendaviesnz opened this issue Jan 25, 2021 · 4 comments
Labels
[Type] Bug An existing feature does not function as intended

Comments

@glendaviesnz
Copy link
Contributor

Description

In some circumstances the bubbles-virtually fill throws a Can't perform a React state update on an unmounted component. warning at https://github.com/WordPress/gutenberg/blob/master/packages/components/src/slot-fill/bubbles-virtually/fill.js#L13.

This warning can be seen when dragging an image out of the refactored gallery PR.

Step-by-step reproduction instructions

  1. Check out the gallery refactor PR
  2. Add a Gallery and add images
  3. Drag and image from the gallery and drop somewhere else on page
  4. Notice state update warning in the console

Expected behaviour

No react state update warnings

Actual behaviour

State update warning show

Screenshots or screen recording (optional)

fill-error

@glendaviesnz glendaviesnz added the [Type] Bug An existing feature does not function as intended label Jan 25, 2021
@glendaviesnz
Copy link
Contributor Author

@diegohaz do you have any thoughts on how to prevent this issue? I struggled to see an easy way to check if the component was still mounted before running the setState in Fill.

@senadir
Copy link
Contributor

senadir commented Mar 16, 2021

We're also seeing this issue on our SlotFill usage.

@nerrad
Copy link
Contributor

nerrad commented Apr 9, 2021

@glendaviesnz #30667 just got merged that should fix this. Do you want to try it and confirm?

@glendaviesnz
Copy link
Contributor Author

Thanks for the ping @nerrad. This appears to be fixed by #30667, no longer happens after rebasing the gallery refactor PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

3 participants