diff --git a/packages/react/src/__tests__/ReactStrictMode-test.internal.js b/packages/react/src/__tests__/ReactStrictMode-test.internal.js index ed9ee70279648..2867e06483792 100644 --- a/packages/react/src/__tests__/ReactStrictMode-test.internal.js +++ b/packages/react/src/__tests__/ReactStrictMode-test.internal.js @@ -179,6 +179,40 @@ describe('ReactStrictMode', () => { 'B: useEffect mount', ]); }); + + it('should support nested strict mode on initial mount', async () => { + function Wrapper({children}) { + return children; + } + await act(() => { + const container = document.createElement('div'); + const root = ReactDOMClient.createRoot(container); + root.render( + + + + , + + , + , + ); + }); + + expect(log).toEqual([ + 'A: render', + 'B: render', + 'B: render', + 'A: useLayoutEffect mount', + 'B: useLayoutEffect mount', + 'A: useEffect mount', + 'B: useEffect mount', + // TODO: this is currently broken + // 'B: useLayoutEffect unmount', + // 'B: useEffect unmount', + // 'B: useLayoutEffect mount', + // 'B: useEffect mount', + ]); + }); } }); });