- 
                Notifications
    You must be signed in to change notification settings 
- Fork 1.1k
fix(unmount): Flush useEffect cleanup functions syncronously #746
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(unmount): Flush useEffect cleanup functions syncronously #746
Conversation
| This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 3865525: 
 | 
ba59d1f    to
    6ef64ea      
    Compare
  
    | Codecov Report
 @@            Coverage Diff            @@
##            master      #746   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            4         4           
  Lines          100       101    +1     
  Branches        16        16           
=========================================
+ Hits           100       101    +1     
 Continue to review full report at Codecov. 
 | 
| just a question, this should be done also here? react-testing-library/src/pure.js Line 109 in 240900c 
 EDIT | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. Thanks 👍
| 🎉 This PR is included in version 10.4.7 🎉 The release is available on: 
 Your semantic-release bot 📦🚀 | 
What:
Flush cleanup functions from
useEffectsynchronously onunmount.Why:
react@nextno longer flushes cleanup functions fromuseEffectsynchronously.Verified in https://travis-ci.org/github/testing-library/react-testing-library/builds/708314737
How:
Wrap
unmountComponentAtNodeinact.Checklist:
[ ]Documentation added to thedocs site
[ ]Typescript definitions updatedI'm not touching
cleanupandflush-microtasksfor now. We can do that in a follow-up PR that we test extensively against existing repos.