You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Replace Implicit Options on SuspenseList with Explicit Options (#33424)
We want to change the defaults for `revealOrder` and `tail` on
SuspenseList. This is an intermediate step to allow experimental users
to upgrade.
To explicitly specify these options I added `revealOrder="independent"`
and `tail="visible"`.
I then added warnings if `undefined` or `null` is passed. You must now
always explicitly specify them. However, semantics are still preserved
for now until the next step.
We also want to change the rendering order of the `children` prop for
`revealOrder="backwards"`. As an intermediate step I first added
`revealOrder="unstable_legacy-backwards"` option. This will only be
temporary until all users can switch to the new `"backwards"` semantics
once we flip it in the next step.
I also clarified the types that the directional props requires iterable
children but not iterable inside of those. Rows with multiple items can
be modeled as explicit fragments.
DiffTrain build for [d742611](d742611)
'The default for the <SuspenseList revealOrder="..."> prop is changing. To be future compatible you must explictly specify either "independent" (the current default), "together", "forwards" or "legacy_unstable-backwards".'
8390
+
);
8391
+
else if ("backwards" === revealOrder)
8392
+
console.error(
8393
+
'The rendering order of <SuspenseList revealOrder="backwards"> is changing. To be future compatible you must specify revealOrder="legacy_unstable-backwards" instead.'
8394
+
);
8395
+
else if ("string" === typeof revealOrder)
8385
8396
switch (revealOrder.toLowerCase()) {
8386
8397
case "together":
8387
8398
case "forwards":
8388
8399
case "backwards":
8400
+
case "independent":
8389
8401
console.error(
8390
8402
'"%s" is not a valid value for revealOrder on <SuspenseList />. Use lowercase "%s" instead.',
8391
8403
revealOrder,
@@ -8402,32 +8414,48 @@ __DEV__ &&
8402
8414
break;
8403
8415
default:
8404
8416
console.error(
8405
-
'"%s" is not a supported revealOrder on <SuspenseList />. Did you mean "together", "forwards" or "backwards"?',
8417
+
'"%s" is not a supported revealOrder on <SuspenseList />. Did you mean "independent", "together", "forwards" or "backwards"?',
8406
8418
revealOrder
8407
8419
);
8408
8420
}
8409
8421
else
8410
8422
console.error(
8411
-
'%s is not a supported value for revealOrder on <SuspenseList />. Did you mean "together", "forwards" or "backwards"?',
8423
+
'%s is not a supported value for revealOrder on <SuspenseList />. Did you mean "independent", "together", "forwards" or "backwards"?',
'The default for the <SuspenseList tail="..."> prop is changing. To be future compatible you must explictly specify either "visible" (the current default), "collapsed" or "hidden".'
'The default for the <SuspenseList revealOrder="..."> prop is changing. To be future compatible you must explictly specify either "independent" (the current default), "together", "forwards" or "legacy_unstable-backwards".'
8221
+
);
8222
+
else if ("backwards" === revealOrder)
8223
+
console.error(
8224
+
'The rendering order of <SuspenseList revealOrder="backwards"> is changing. To be future compatible you must specify revealOrder="legacy_unstable-backwards" instead.'
8225
+
);
8226
+
else if ("string" === typeof revealOrder)
8216
8227
switch (revealOrder.toLowerCase()) {
8217
8228
case "together":
8218
8229
case "forwards":
8219
8230
case "backwards":
8231
+
case "independent":
8220
8232
console.error(
8221
8233
'"%s" is not a valid value for revealOrder on <SuspenseList />. Use lowercase "%s" instead.',
8222
8234
revealOrder,
@@ -8233,32 +8245,48 @@ __DEV__ &&
8233
8245
break;
8234
8246
default:
8235
8247
console.error(
8236
-
'"%s" is not a supported revealOrder on <SuspenseList />. Did you mean "together", "forwards" or "backwards"?',
8248
+
'"%s" is not a supported revealOrder on <SuspenseList />. Did you mean "independent", "together", "forwards" or "backwards"?',
8237
8249
revealOrder
8238
8250
);
8239
8251
}
8240
8252
else
8241
8253
console.error(
8242
-
'%s is not a supported value for revealOrder on <SuspenseList />. Did you mean "together", "forwards" or "backwards"?',
8254
+
'%s is not a supported value for revealOrder on <SuspenseList />. Did you mean "independent", "together", "forwards" or "backwards"?',
'The default for the <SuspenseList tail="..."> prop is changing. To be future compatible you must explictly specify either "visible" (the current default), "collapsed" or "hidden".'
0 commit comments