File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed
src/internal/utils/__tests__ Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -26,8 +26,10 @@ describe('flattenChildren', () => {
2626 </ Fragment >
2727 ) ;
2828
29+ // Tests React 19+ behavior: uses Children.toArray() which does NOT flatten fragments
2930 describe ( 'React 19+' , ( ) => {
3031 beforeEach ( ( ) => {
32+ // Mock React.version to trigger Children.toArray() code path
3133 Object . defineProperty ( React , 'version' , {
3234 value : '19.0.0' ,
3335 writable : true ,
@@ -45,8 +47,10 @@ describe('flattenChildren', () => {
4547 } ) ;
4648 } ) ;
4749
50+ // Tests React 16-18 behavior: uses react-keyed-flatten-children which DOES flatten fragments
4851 describe ( 'React 16-18' , ( ) => {
4952 beforeEach ( ( ) => {
53+ // Mock React.version to trigger react-keyed-flatten-children code path
5054 Object . defineProperty ( React , 'version' , {
5155 value : '18.2.0' ,
5256 writable : true ,
You can’t perform that action at this time.
0 commit comments