Skip to content

Commit 754f72a

Browse files
committed
Don't visit siblings of the coroutine when looking for yields
When visiting the yields, the root is the stateNode of the coroutine. If its return value is wrong we'll end up at the alternate of the workInProgress which will start scanning its children which is wrong.
1 parent e8500fb commit 754f72a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/renderers/shared/fiber/ReactFiberCompleteWork.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ module.exports = function<T, P, I, TI, PI, C, CX, PL>(
8585

8686
function appendAllYields(yields : Array<mixed>, workInProgress : Fiber) {
8787
let node = workInProgress.stateNode;
88+
if (node) {
89+
node.return = workInProgress;
90+
}
8891
while (node) {
8992
if (node.tag === HostComponent || node.tag === HostText ||
9093
node.tag === HostPortal) {
@@ -96,9 +99,6 @@ module.exports = function<T, P, I, TI, PI, C, CX, PL>(
9699
node = node.child;
97100
continue;
98101
}
99-
if (node === workInProgress) {
100-
return;
101-
}
102102
while (!node.sibling) {
103103
if (!node.return || node.return === workInProgress) {
104104
return;

0 commit comments

Comments
 (0)