Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/__tests__/cleanup.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ test('cleanup waits for queued microtasks during unmount sequence', async () =>
const spy = jest.fn()

const Test = () => {
React.useEffect(() => () => setImmediate(spy))
React.useEffect(() => () => setTimeout(spy, 200))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Users can do all kinds of async things as a result of their cleanup functions and it's not reasonable for them to expect that we'll wait until all those async things are done. They'll have to wait for those things themselves.

So we shouldn't have a setImmediate in here at all.


return null
}
Expand Down