|
6859 | 6859 | }
|
6860 | 6860 | };
|
6861 | 6861 | }
|
| 6862 | + function validateSuspenseListNestedChild(childSlot, index) { |
| 6863 | + var isAnArray = isArrayImpl(childSlot), |
| 6864 | + isIterable = |
| 6865 | + !isAnArray && "function" === typeof getIteratorFn(childSlot); |
| 6866 | + childSlot = |
| 6867 | + "object" === typeof childSlot && |
| 6868 | + null !== childSlot && |
| 6869 | + "function" === typeof childSlot[ASYNC_ITERATOR]; |
| 6870 | + return isAnArray || isIterable || childSlot |
| 6871 | + ? ((isAnArray = isAnArray |
| 6872 | + ? "array" |
| 6873 | + : childSlot |
| 6874 | + ? "async iterable" |
| 6875 | + : "iterable"), |
| 6876 | + console.error( |
| 6877 | + "A nested %s was passed to row #%s in <SuspenseList />. Wrap it in an additional SuspenseList to configure its revealOrder: <SuspenseList revealOrder=...> ... <SuspenseList revealOrder=...>{%s}</SuspenseList> ... </SuspenseList>", |
| 6878 | + isAnArray, |
| 6879 | + index, |
| 6880 | + isAnArray |
| 6881 | + ), |
| 6882 | + !1) |
| 6883 | + : !0; |
| 6884 | + } |
6862 | 6885 | function initializeUpdateQueue(fiber) {
|
6863 | 6886 | fiber.updateQueue = {
|
6864 | 6887 | baseState: fiber.memoizedState,
|
|
10896 | 10919 | propagationRoot
|
10897 | 10920 | );
|
10898 | 10921 | }
|
10899 |
| - function validateSuspenseListNestedChild(childSlot, index) { |
10900 |
| - var isAnArray = isArrayImpl(childSlot); |
10901 |
| - childSlot = !isAnArray && "function" === typeof getIteratorFn(childSlot); |
10902 |
| - return isAnArray || childSlot |
10903 |
| - ? ((isAnArray = isAnArray ? "array" : "iterable"), |
10904 |
| - console.error( |
10905 |
| - "A nested %s was passed to row #%s in <SuspenseList />. Wrap it in an additional SuspenseList to configure its revealOrder: <SuspenseList revealOrder=...> ... <SuspenseList revealOrder=...>{%s}</SuspenseList> ... </SuspenseList>", |
10906 |
| - isAnArray, |
10907 |
| - index, |
10908 |
| - isAnArray |
10909 |
| - ), |
10910 |
| - !1) |
10911 |
| - : !0; |
10912 |
| - } |
10913 | 10922 | function initSuspenseListRenderState(
|
10914 | 10923 | workInProgress,
|
10915 | 10924 | isBackwards,
|
|
10939 | 10948 | revealOrder = nextProps.revealOrder,
|
10940 | 10949 | tailMode = nextProps.tail;
|
10941 | 10950 | nextProps = nextProps.children;
|
| 10951 | + var suspenseContext = suspenseStackCursor.current, |
| 10952 | + shouldForceFallback = 0 !== (suspenseContext & ForceSuspenseFallback); |
| 10953 | + shouldForceFallback |
| 10954 | + ? ((suspenseContext = |
| 10955 | + (suspenseContext & SubtreeSuspenseContextMask) | |
| 10956 | + ForceSuspenseFallback), |
| 10957 | + (workInProgress.flags |= 128)) |
| 10958 | + : (suspenseContext &= SubtreeSuspenseContextMask); |
| 10959 | + push(suspenseStackCursor, suspenseContext, workInProgress); |
10942 | 10960 | if (
|
10943 | 10961 | void 0 !== revealOrder &&
|
10944 | 10962 | "forwards" !== revealOrder &&
|
@@ -11001,55 +11019,74 @@
|
11001 | 11019 | !1 !== nextProps
|
11002 | 11020 | )
|
11003 | 11021 | if (isArrayImpl(nextProps))
|
11004 |
| - for (var i = 0; i < nextProps.length; i++) { |
11005 |
| - if (!validateSuspenseListNestedChild(nextProps[i], i)) break a; |
| 11022 | + for ( |
| 11023 | + suspenseContext = 0; |
| 11024 | + suspenseContext < nextProps.length; |
| 11025 | + suspenseContext++ |
| 11026 | + ) { |
| 11027 | + if ( |
| 11028 | + !validateSuspenseListNestedChild( |
| 11029 | + nextProps[suspenseContext], |
| 11030 | + suspenseContext |
| 11031 | + ) |
| 11032 | + ) |
| 11033 | + break a; |
11006 | 11034 | }
|
11007 |
| - else if (((i = getIteratorFn(nextProps)), "function" === typeof i)) { |
11008 |
| - if ((i = i.call(nextProps))) |
11009 |
| - for (var step = i.next(), _i = 0; !step.done; step = i.next()) { |
| 11035 | + else if ( |
| 11036 | + ((suspenseContext = getIteratorFn(nextProps)), |
| 11037 | + "function" === typeof suspenseContext) |
| 11038 | + ) { |
| 11039 | + if ((suspenseContext = suspenseContext.call(nextProps))) |
| 11040 | + for ( |
| 11041 | + var step = suspenseContext.next(), _i = 0; |
| 11042 | + !step.done; |
| 11043 | + step = suspenseContext.next() |
| 11044 | + ) { |
11010 | 11045 | if (!validateSuspenseListNestedChild(step.value, _i)) break a;
|
11011 | 11046 | _i++;
|
11012 | 11047 | }
|
11013 | 11048 | } else
|
11014 |
| - console.error( |
11015 |
| - 'A single row was passed to a <SuspenseList revealOrder="%s" />. This is not useful since it needs multiple rows. Did you mean to pass multiple children or an array?', |
11016 |
| - revealOrder |
11017 |
| - ); |
| 11049 | + "function" !== typeof nextProps[ASYNC_ITERATOR] && |
| 11050 | + (nextProps.$$typeof !== REACT_ELEMENT_TYPE || |
| 11051 | + "function" !== typeof nextProps.type || |
| 11052 | + ("[object GeneratorFunction]" !== |
| 11053 | + Object.prototype.toString.call(nextProps.type) && |
| 11054 | + "[object AsyncGeneratorFunction]" !== |
| 11055 | + Object.prototype.toString.call(nextProps.type)) |
| 11056 | + ? console.error( |
| 11057 | + 'A single row was passed to a <SuspenseList revealOrder="%s" />. This is not useful since it needs multiple rows. Did you mean to pass multiple children or an array?', |
| 11058 | + revealOrder |
| 11059 | + ) |
| 11060 | + : console.error( |
| 11061 | + 'A generator Component was passed to a <SuspenseList revealOrder="%s" />. This is not supported as a way to generate lists. Instead, pass an iterable as the children.', |
| 11062 | + revealOrder |
| 11063 | + )); |
11018 | 11064 | reconcileChildren(current, workInProgress, nextProps, renderLanes);
|
11019 |
| - nextProps = suspenseStackCursor.current; |
11020 |
| - if (0 !== (nextProps & ForceSuspenseFallback)) |
11021 |
| - (nextProps = |
11022 |
| - (nextProps & SubtreeSuspenseContextMask) | ForceSuspenseFallback), |
11023 |
| - (workInProgress.flags |= 128); |
11024 |
| - else { |
11025 |
| - if (null !== current && 0 !== (current.flags & 128)) |
11026 |
| - a: for (current = workInProgress.child; null !== current; ) { |
11027 |
| - if (13 === current.tag) |
11028 |
| - null !== current.memoizedState && |
11029 |
| - scheduleSuspenseWorkOnFiber( |
11030 |
| - current, |
11031 |
| - renderLanes, |
11032 |
| - workInProgress |
11033 |
| - ); |
11034 |
| - else if (19 === current.tag) |
| 11065 | + if ( |
| 11066 | + !shouldForceFallback && |
| 11067 | + null !== current && |
| 11068 | + 0 !== (current.flags & 128) |
| 11069 | + ) |
| 11070 | + a: for (current = workInProgress.child; null !== current; ) { |
| 11071 | + if (13 === current.tag) |
| 11072 | + null !== current.memoizedState && |
11035 | 11073 | scheduleSuspenseWorkOnFiber(current, renderLanes, workInProgress);
|
11036 |
| - else if (null !== current.child) { |
11037 |
| - current.child.return = current; |
11038 |
| - current = current.child; |
11039 |
| - continue; |
11040 |
| - } |
11041 |
| - if (current === workInProgress) break a; |
11042 |
| - for (; null === current.sibling; ) { |
11043 |
| - if (null === current.return || current.return === workInProgress) |
11044 |
| - break a; |
11045 |
| - current = current.return; |
11046 |
| - } |
11047 |
| - current.sibling.return = current.return; |
11048 |
| - current = current.sibling; |
| 11074 | + else if (19 === current.tag) |
| 11075 | + scheduleSuspenseWorkOnFiber(current, renderLanes, workInProgress); |
| 11076 | + else if (null !== current.child) { |
| 11077 | + current.child.return = current; |
| 11078 | + current = current.child; |
| 11079 | + continue; |
11049 | 11080 | }
|
11050 |
| - nextProps &= SubtreeSuspenseContextMask; |
11051 |
| - } |
11052 |
| - push(suspenseStackCursor, nextProps, workInProgress); |
| 11081 | + if (current === workInProgress) break a; |
| 11082 | + for (; null === current.sibling; ) { |
| 11083 | + if (null === current.return || current.return === workInProgress) |
| 11084 | + break a; |
| 11085 | + current = current.return; |
| 11086 | + } |
| 11087 | + current.sibling.return = current.return; |
| 11088 | + current = current.sibling; |
| 11089 | + } |
11053 | 11090 | switch (revealOrder) {
|
11054 | 11091 | case "forwards":
|
11055 | 11092 | renderLanes = workInProgress.child;
|
@@ -30579,11 +30616,11 @@
|
30579 | 30616 | };
|
30580 | 30617 | (function () {
|
30581 | 30618 | var isomorphicReactPackageVersion = React.version;
|
30582 |
| - if ("19.2.0-experimental-462d08f9-20250517" !== isomorphicReactPackageVersion) |
| 30619 | + if ("19.2.0-experimental-c4676e72-20250520" !== isomorphicReactPackageVersion) |
30583 | 30620 | throw Error(
|
30584 | 30621 | 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' +
|
30585 | 30622 | (isomorphicReactPackageVersion +
|
30586 |
| - "\n - react-dom: 19.2.0-experimental-462d08f9-20250517\nLearn more: https://react.dev/warnings/version-mismatch") |
| 30623 | + "\n - react-dom: 19.2.0-experimental-c4676e72-20250520\nLearn more: https://react.dev/warnings/version-mismatch") |
30587 | 30624 | );
|
30588 | 30625 | })();
|
30589 | 30626 | ("function" === typeof Map &&
|
@@ -30620,10 +30657,10 @@
|
30620 | 30657 | !(function () {
|
30621 | 30658 | var internals = {
|
30622 | 30659 | bundleType: 1,
|
30623 |
| - version: "19.2.0-experimental-462d08f9-20250517", |
| 30660 | + version: "19.2.0-experimental-c4676e72-20250520", |
30624 | 30661 | rendererPackageName: "react-dom",
|
30625 | 30662 | currentDispatcherRef: ReactSharedInternals,
|
30626 |
| - reconcilerVersion: "19.2.0-experimental-462d08f9-20250517" |
| 30663 | + reconcilerVersion: "19.2.0-experimental-c4676e72-20250520" |
30627 | 30664 | };
|
30628 | 30665 | internals.overrideHookState = overrideHookState;
|
30629 | 30666 | internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
|
|
30769 | 30806 | listenToAllSupportedEvents(container);
|
30770 | 30807 | return new ReactDOMHydrationRoot(initialChildren);
|
30771 | 30808 | };
|
30772 |
| - exports.version = "19.2.0-experimental-462d08f9-20250517"; |
| 30809 | + exports.version = "19.2.0-experimental-c4676e72-20250520"; |
30773 | 30810 | "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
|
30774 | 30811 | "function" ===
|
30775 | 30812 | typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
|
|
0 commit comments