Skip to content

Commit a44f19b

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 we treat the coroutine itself as the root, then we'll start looking through its children.
1 parent e8500fb commit a44f19b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/renderers/shared/fiber/ReactFiberCompleteWork.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ module.exports = function<T, P, I, TI, PI, C, CX, PL>(
8484
}
8585

8686
function appendAllYields(yields : Array<mixed>, workInProgress : Fiber) {
87-
let node = workInProgress.stateNode;
87+
const root = workInProgress.stateNode;
88+
let node = root;
8889
while (node) {
8990
if (node.tag === HostComponent || node.tag === HostText ||
9091
node.tag === HostPortal) {
@@ -96,11 +97,11 @@ module.exports = function<T, P, I, TI, PI, C, CX, PL>(
9697
node = node.child;
9798
continue;
9899
}
99-
if (node === workInProgress) {
100+
if (node === root) {
100101
return;
101102
}
102103
while (!node.sibling) {
103-
if (!node.return || node.return === workInProgress) {
104+
if (!node.return || node.return === root) {
104105
return;
105106
}
106107
node = node.return;

0 commit comments

Comments
 (0)