Skip to content

Commit 2388481

Browse files
authored
[Fizz] Set keyPath for SuspenseList (facebook#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.
1 parent 9c7b10e commit 2388481

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/react-server/src/ReactFizzServer.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1783,6 +1783,8 @@ function renderSuspenseListRows(
17831783
): void {
17841784
// This is a fork of renderChildrenArray that's aware of tracking rows.
17851785
const prevKeyPath = task.keyPath;
1786+
const prevTreeContext = task.treeContext;
1787+
const prevRow = task.row;
17861788
const previousComponentStack = task.componentStack;
17871789
let previousDebugTask = null;
17881790
if (__DEV__) {
@@ -1792,10 +1794,9 @@ function renderSuspenseListRows(
17921794
pushServerComponentStack(task, (task.node: any).props.children._debugInfo);
17931795
}
17941796

1795-
const prevTreeContext = task.treeContext;
1796-
const prevRow = task.row;
1797-
const totalChildren = rows.length;
1797+
task.keyPath = keyPath;
17981798

1799+
const totalChildren = rows.length;
17991800
let previousSuspenseListRow: null | SuspenseListRow = null;
18001801
if (task.replay !== null) {
18011802
// Replay

0 commit comments

Comments
 (0)