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(Modal|Portal): fix an error with unsafe setState() #4259

Merged
merged 1 commit into from
Jul 28, 2021

Conversation

layershifter
Copy link
Member

Fixes #4200.


This PR fixes a reported issue in #4200. It happens when a component gets unmounted before .setState() call.
Test that covers this scenario is also added.

@github-actions
Copy link

size-limit report

Path Size
bundle-size/dist/Button.size.js 58.73 KB (0%)
bundle-size/dist/Icon.size.js 25.21 KB (0%)
bundle-size/dist/Image.size.js 53.91 KB (0%)
bundle-size/dist/Modal.size.js 68.87 KB (0%)
bundle-size/dist/Portal.size.js 40.61 KB (0%)

@codecov-commenter
Copy link

codecov-commenter commented Jul 28, 2021

Codecov Report

Merging #4259 (f5e56e4) into master (ad83d82) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #4259   +/-   ##
=======================================
  Coverage   99.75%   99.75%           
=======================================
  Files         180      180           
  Lines        3241     3241           
=======================================
  Hits         3233     3233           
  Misses          8        8           
Impacted Files Coverage Δ
src/addons/Portal/Portal.js 100.00% <100.00%> (ø)
src/modules/Modal/Modal.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ad83d82...f5e56e4. Read the comment docs.

@layershifter layershifter merged commit dd4de18 into master Jul 28, 2021
@layershifter layershifter deleted the fix/modal-error-setstate branch July 28, 2021 12:07
@laukaichung
Copy link

Thank you for the fix. When would you expect it to be released?

@layershifter
Copy link
Member Author

@laukaichung it was released yesterday 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Warning when closing Modal "Can't perform a React state update on an unmounted component."
3 participants