@samitouri / QOS-React / commits / 754f72a175

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.

Sebastian Markbage committed Jan 25, 2017 at 17:36 UTC 754f72a175f8448d9f0851a2a041ca0ceb12a46e
1 file changed +3 -3
src/renderers/shared/fiber/ReactFiberCompleteWork.js
+3 -3
@@ -85,6 +85,9 @@ module.exports = function<T, P, I, TI, PI, C, CX, PL>(
85
86 function appendAllYields(yields : Array<mixed>, workInProgress : Fiber) {
87 let node = workInProgress.stateNode;
88 + if (node) {
89 + node.return = workInProgress;
90 + }
91 while (node) {
92 if (node.tag === HostComponent || node.tag === HostText ||
93 node.tag === HostPortal) {
@@ -96,9 +99,6 @@ module.exports = function<T, P, I, TI, PI, C, CX, PL>(
99 node = node.child;
100 continue;
101 }
99 - if (node === workInProgress) {
100 - return;
101 - }
102 while (!node.sibling) {
103 if (!node.return || node.return === workInProgress) {
104 return;