Fix: Initialize childIndex in Task constructor (#27367)
This field was not being initialized. Although the property is part of the Flow type, the type error wasn't caught because the constructor itself is not covered by Flow, which is unfortunate. (I assume this is related to the dev-only componentStack property.)
Andrew Clark committed
Sep 12, 2023 at 22:17 UTC
69be472c11231056d297a7b73dd0b121905606d3
1 file changed
+1
packages/react-server/src/ReactFizzServer.js
+1
@@ -578,6 +578,7 @@ function createTask(
578
context,
579
treeContext,
580
thenableState,
581
+ childIndex: -1,
582
}: any);
583
if (__DEV__) {
584
task.componentStack = null;