mirror of
https://github.com/zebrajr/react.git
synced 2025-12-06 12:20:20 +01:00
Hot reloading: Avoid stack overflow on wide trees (#34145)
Every sibling added to the stack here. Not sure this needs to be recursive at all but certainly for siblings this can just be a loop.
This commit is contained in:
parent
3958d5d84b
commit
cf6e502ed2
|
|
@ -261,6 +261,7 @@ function scheduleFibersWithFamiliesRecursively(
|
|||
staleFamilies: Set<Family>,
|
||||
): void {
|
||||
if (__DEV__) {
|
||||
do {
|
||||
const {alternate, child, sibling, tag, type} = fiber;
|
||||
|
||||
let candidateType = null;
|
||||
|
|
@ -323,12 +324,11 @@ function scheduleFibersWithFamiliesRecursively(
|
|||
staleFamilies,
|
||||
);
|
||||
}
|
||||
if (sibling !== null) {
|
||||
scheduleFibersWithFamiliesRecursively(
|
||||
sibling,
|
||||
updatedFamilies,
|
||||
staleFamilies,
|
||||
);
|
||||
}
|
||||
|
||||
if (sibling === null) {
|
||||
break;
|
||||
}
|
||||
fiber = sibling;
|
||||
} while (true);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user