Skip to content

Commit 5af49d5

Browse files
committed
enable the existing test case instead
1 parent f8dddae commit 5af49d5

File tree

2 files changed

+4
-63
lines changed

2 files changed

+4
-63
lines changed

packages/react-reconciler/src/__tests__/StrictEffectsModeDefaults-test.internal.js

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -240,64 +240,6 @@ describe('StrictEffectsMode defaults', () => {
240240
});
241241
});
242242

243-
it('should double invoke effects in a mounted strict subtree', async () => {
244-
const log = [];
245-
function ComponentWithEffects({label}) {
246-
React.useEffect(() => {
247-
log.push(`useEffect mount "${label}"`);
248-
Scheduler.log(`useEffect mount "${label}"`);
249-
return () => {
250-
log.push(`useEffect unmount "${label}"`);
251-
Scheduler.log(`useEffect unmount "${label}"`);
252-
};
253-
});
254-
255-
React.useLayoutEffect(() => {
256-
log.push(`useLayoutEffect mount "${label}"`);
257-
Scheduler.log(`useLayoutEffect mount "${label}"`);
258-
return () => {
259-
log.push(`useLayoutEffect unmount "${label}"`);
260-
Scheduler.log(`useLayoutEffect unmount "${label}"`);
261-
};
262-
});
263-
264-
return label;
265-
}
266-
267-
// this component intentionally introduces a component layer between the root and the StrictMode
268-
function RenderChildren({children}) {
269-
return children;
270-
}
271-
272-
await act(async () => {
273-
ReactNoop.render(
274-
<RenderChildren>
275-
<ComponentWithEffects label={'one'} />
276-
<React.StrictMode>
277-
<ComponentWithEffects label={'two'} />
278-
</React.StrictMode>
279-
</RenderChildren>,
280-
);
281-
282-
await waitForAll([
283-
'useLayoutEffect mount "one"',
284-
'useLayoutEffect mount "two"',
285-
'useEffect mount "one"',
286-
'useEffect mount "two"',
287-
]);
288-
expect(log).toEqual([
289-
'useLayoutEffect mount "one"',
290-
'useLayoutEffect mount "two"',
291-
'useEffect mount "one"',
292-
'useEffect mount "two"',
293-
'useLayoutEffect unmount "two"',
294-
'useEffect unmount "two"',
295-
'useLayoutEffect mount "two"',
296-
'useEffect mount "two"',
297-
]);
298-
});
299-
});
300-
301243
it('double invoking for effects for modern roots', async () => {
302244
const log = [];
303245
function App({text}) {

packages/react/src/__tests__/ReactStrictMode-test.internal.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -206,11 +206,10 @@ describe('ReactStrictMode', () => {
206206
'B: useLayoutEffect mount',
207207
'A: useEffect mount',
208208
'B: useEffect mount',
209-
// TODO: this is currently broken
210-
// 'B: useLayoutEffect unmount',
211-
// 'B: useEffect unmount',
212-
// 'B: useLayoutEffect mount',
213-
// 'B: useEffect mount',
209+
'B: useLayoutEffect unmount',
210+
'B: useEffect unmount',
211+
'B: useLayoutEffect mount',
212+
'B: useEffect mount',
214213
]);
215214
});
216215
}

0 commit comments

Comments
 (0)