@samitouri / QOS-React-2 / commits / 2388481283

[Fizz] Set keyPath for SuspenseList (#33320)

I missed setting the `keyPath` because the `renderChildrenArray` that this is forked from doesn't need to set a path but since this is rendered from the `SuspenseList` element it needs it.

Sebastian Markbåge committed May 20, 2025 at 21:08 UTC 2388481283640d034fd6b4edfca4f11e67953673
1 file changed +4 -3
packages/react-server/src/ReactFizzServer.js
+4 -3
@@ -1783,6 +1783,8 @@ function renderSuspenseListRows(
1783 ): void {
1784 // This is a fork of renderChildrenArray that's aware of tracking rows.
1785 const prevKeyPath = task.keyPath;
1786 + const prevTreeContext = task.treeContext;
1787 + const prevRow = task.row;
1788 const previousComponentStack = task.componentStack;
1789 let previousDebugTask = null;
1790 if (__DEV__) {
@@ -1792,10 +1794,9 @@ function renderSuspenseListRows(
1794 pushServerComponentStack(task, (task.node: any).props.children._debugInfo);
1795 }
1796
1795 - const prevTreeContext = task.treeContext;
1796 - const prevRow = task.row;
1797 - const totalChildren = rows.length;
1797 + task.keyPath = keyPath;
1798
1799 + const totalChildren = rows.length;
1800 let previousSuspenseListRow: null | SuspenseListRow = null;
1801 if (task.replay !== null) {
1802 // Replay