@@ -3245,20 +3245,15 @@ function validateRevealOrder(revealOrder: SuspenseListRevealOrder) {
32453245 if ( __DEV__ ) {
32463246 const cacheKey = revealOrder == null ? 'null' : revealOrder ;
32473247 if (
3248+ revealOrder != null &&
32483249 revealOrder !== 'forwards' &&
32493250 revealOrder !== 'unstable_legacy-backwards' &&
32503251 revealOrder !== 'together' &&
32513252 revealOrder !== 'independent' &&
32523253 ! didWarnAboutRevealOrder [ cacheKey ]
32533254 ) {
32543255 didWarnAboutRevealOrder [ cacheKey ] = true ;
3255- if ( revealOrder == null ) {
3256- console . error (
3257- 'The default for the <SuspenseList revealOrder="..."> prop is changing. ' +
3258- 'To be future compatible you must explictly specify either ' +
3259- '"independent" (the current default), "together", "forwards" or "legacy_unstable-backwards".' ,
3260- ) ;
3261- } else if ( revealOrder === 'backwards ') {
3256+ if ( revealOrder === 'backwards' ) {
32623257 console . error (
32633258 'The rendering order of <SuspenseList revealOrder="backwards"> is changing. ' +
32643259 'To be future compatible you must specify revealOrder="legacy_unstable-backwards" instead.' ,
@@ -3314,18 +3309,7 @@ function validateTailOptions(
33143309 const cacheKey = tailMode == null ? 'null' : tailMode ;
33153310 if ( ! didWarnAboutTailOptions [ cacheKey ] ) {
33163311 if ( tailMode == null ) {
3317- if (
3318- revealOrder === 'forwards' ||
3319- revealOrder === 'backwards' ||
3320- revealOrder === 'unstable_legacy-backwards'
3321- ) {
3322- didWarnAboutTailOptions [ cacheKey ] = true ;
3323- console . error (
3324- 'The default for the <SuspenseList tail="..."> prop is changing. ' +
3325- 'To be future compatible you must explictly specify either ' +
3326- '"visible" (the current default), "collapsed" or "hidden".' ,
3327- ) ;
3328- }
3312+ // The default tail is now "hidden".
33293313 } else if (
33303314 tailMode !== 'visible' &&
33313315 tailMode !== 'collapsed' &&
@@ -3338,14 +3322,15 @@ function validateTailOptions(
33383322 tailMode ,
33393323 ) ;
33403324 } else if (
3325+ revealOrder != null &&
33413326 revealOrder !== 'forwards' &&
33423327 revealOrder !== 'backwards' &&
33433328 revealOrder !== 'unstable_legacy-backwards'
33443329 ) {
33453330 didWarnAboutTailOptions [ cacheKey ] = true ;
33463331 console . error (
33473332 '<SuspenseList tail="%s" /> is only valid if revealOrder is ' +
3348- '"forwards" or "backwards". ' +
3333+ '"forwards" (default) or "backwards". ' +
33493334 'Did you mean to specify revealOrder="forwards"?' ,
33503335 tailMode ,
33513336 ) ;
@@ -3449,30 +3434,6 @@ function updateSuspenseListComponent(
34493434 workInProgress . memoizedState = null ;
34503435 } else {
34513436 switch ( revealOrder ) {
3452- case 'forwards ': {
3453- const lastContentRow = findLastContentRow ( workInProgress . child ) ;
3454- let tail ;
3455- if ( lastContentRow === null ) {
3456- // The whole list is part of the tail.
3457- // TODO: We could fast path by just rendering the tail now.
3458- tail = workInProgress . child ;
3459- workInProgress . child = null ;
3460- } else {
3461- // Disconnect the tail rows after the content row.
3462- // We're going to render them separately later.
3463- tail = lastContentRow . sibling ;
3464- lastContentRow . sibling = null ;
3465- }
3466- initSuspenseListRenderState (
3467- workInProgress ,
3468- false , // isBackwards
3469- tail ,
3470- lastContentRow ,
3471- tailMode ,
3472- treeForkCount ,
3473- ) ;
3474- break ;
3475- }
34763437 case 'backwards ':
34773438 case 'unstable_legacy-backwards' : {
34783439 // We're going to find the first row that has existing content.
@@ -3517,10 +3478,37 @@ function updateSuspenseListComponent(
35173478 ) ;
35183479 break ;
35193480 }
3520- default : {
3521- // The default reveal order is the same as not having
3481+ case ' independent ' : {
3482+ // The "independent" reveal order is the same as not having
35223483 // a boundary.
35233484 workInProgress . memoizedState = null ;
3485+ break ;
3486+ }
3487+ // The default is now forwards.
3488+ case 'forwards ':
3489+ default : {
3490+ const lastContentRow = findLastContentRow ( workInProgress . child ) ;
3491+ let tail ;
3492+ if ( lastContentRow === null ) {
3493+ // The whole list is part of the tail.
3494+ // TODO: We could fast path by just rendering the tail now.
3495+ tail = workInProgress . child ;
3496+ workInProgress . child = null ;
3497+ } else {
3498+ // Disconnect the tail rows after the content row.
3499+ // We're going to render them separately later.
3500+ tail = lastContentRow . sibling ;
3501+ lastContentRow . sibling = null ;
3502+ }
3503+ initSuspenseListRenderState (
3504+ workInProgress ,
3505+ false , // isBackwards
3506+ tail ,
3507+ lastContentRow ,
3508+ tailMode ,
3509+ treeForkCount ,
3510+ ) ;
3511+ break ;
35243512 }
35253513 }
35263514 }
0 commit comments