@@ -2846,4 +2846,64 @@ describe('ReactFlightDOMBrowser', () => {
28462846
28472847 expect ( container . innerHTML ) . toBe ( '<p>Hi</p>' ) ;
28482848 } ) ;
2849+
2850+ it ( 'should not have missing key warnings when a static child is blocked on debug info' , async ( ) => {
2851+ const ClientComponent = clientExports ( function ClientComponent ( { element} ) {
2852+ return (
2853+ < div >
2854+ < span > Hi</ span >
2855+ { element }
2856+ </ div >
2857+ ) ;
2858+ } ) ;
2859+
2860+ let debugReadableStreamController ;
2861+
2862+ const debugReadableStream = new ReadableStream ( {
2863+ start ( controller ) {
2864+ debugReadableStreamController = controller ;
2865+ } ,
2866+ } ) ;
2867+
2868+ const stream = await serverAct ( ( ) =>
2869+ ReactServerDOMServer . renderToReadableStream (
2870+ < ClientComponent element = { < span > Sebbie</ span > } /> ,
2871+ webpackMap ,
2872+ {
2873+ debugChannel : {
2874+ writable : new WritableStream ( {
2875+ write ( chunk ) {
2876+ debugReadableStreamController . enqueue ( chunk ) ;
2877+ } ,
2878+ close ( ) {
2879+ debugReadableStreamController . close ( ) ;
2880+ } ,
2881+ } ) ,
2882+ } ,
2883+ } ,
2884+ ) ,
2885+ ) ;
2886+
2887+ function ClientRoot ( { response} ) {
2888+ return use ( response ) ;
2889+ }
2890+
2891+ const response = ReactServerDOMClient . createFromReadableStream ( stream , {
2892+ debugChannel : { readable : createDelayedStream ( debugReadableStream ) } ,
2893+ } ) ;
2894+
2895+ const container = document . createElement ( 'div' ) ;
2896+ const root = ReactDOMClient . createRoot ( container ) ;
2897+
2898+ await act ( ( ) => {
2899+ root . render ( < ClientRoot response = { response } /> ) ;
2900+ } ) ;
2901+
2902+ // Wait for the debug info to be processed.
2903+ await act ( ( ) => { } ) ;
2904+
2905+ expect ( container . innerHTML ) . toBe (
2906+ '<div><span>Hi</span><span>Sebbie</span></div>' ,
2907+ ) ;
2908+ } ) ;
28492909} ) ;
0 commit comments