You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/__tests__/events.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -295,7 +295,7 @@ test.each([
295
295
// There are two possible scenarios:
296
296
// 1. If that effect is flushed during the click the native click listener would still receive the event that caused the native listener to be added.
297
297
// 2. If that effect is flushed before we return from fireEvent.click the native click listener would not receive the event that caused the native listener to be added.
298
-
// React flushes effects scheduled from an update by a "discrete" event immediately.
298
+
// React flushes effects scheduled from an update by a "discrete" event immediately if that effect was scheduled from a portaled component.
299
299
// but not effects in a batched context (e.g. act(() => {}))
300
300
// So if we were in act(() => {}), we would see scenario 2 i.e. `onDocumentClick` would not be called
301
301
// If we were not in `act(() => {})`, we would see scenario 1 i.e. `onDocumentClick` would already be called
0 commit comments