Skip to content

Commit c646280

Browse files
committed
Legacy FB support
1 parent 86cac61 commit c646280

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

packages/react-dom/src/__tests__/ReactDOMEventListener-test.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99

1010
'use strict';
1111

12+
import {enableLegacyFBSupport} from 'shared/forks/ReactFeatureFlags.www-dynamic';
13+
1214
describe('ReactDOMEventListener', () => {
1315
let React;
1416
let ReactDOM;
@@ -210,7 +212,14 @@ describe('ReactDOMEventListener', () => {
210212
// isInputPending?).
211213
//
212214
// Since this is a discrete event, the previous update is already done.
213-
expect(mock.mock.calls[1][0]).toBe('1');
215+
if (gate(flags => flags.enableLegacyFBSupport)) {
216+
// Legacy FB support mode attaches to the document, which is a single event
217+
// dispatch for both roots, so this is batched.
218+
expect(mock.mock.calls[1][0]).toBe('Child');
219+
} else {
220+
expect(mock.mock.calls[1][0]).toBe('1');
221+
}
222+
214223
// And by the time we leave the handler, the second update is flushed.
215224
expect(childNode.textContent).toBe('2');
216225
} finally {

0 commit comments

Comments
 (0)