You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,i'm curious why React17 uses a linked list on finishedWork tree instead of using an array to hold fiber nodes with side effects. It seems that it is easier to understand with arrays. Thank you for your answer
leteffectFiberList=[];// an array to hold fiber nodes with side effects// in the deleteChild function, we can add the childToDelete directly to the effectFiberListfunctionChildReconciler(shouldTrackSideEffects){functiondeleteChild(returnFiber,childToDelete){if(!shouldTrackSideEffects){// Noop.return;}// var last = returnFiber.lastEffect;// if (last !== null) {// last.nextEffect = childToDelete;// returnFiber.lastEffect = childToDelete;// } else {// returnFiber.firstEffect = returnFiber.lastEffect = childToDelete;// }effectFiberList.push(childToDelete);// childToDelete.nextEffect = null;childToDelete.flags=Deletion;}}// and in the completeUnitOfWorkfunctioncompleteUnitOfWork(unitOfWork){varcompletedWork=unitOfWork;do{// ....varflags=completedWork.flags;if(flags>PerformedWork){// if (returnFiber.lastEffect !== null) {// returnFiber.lastEffect.nextEffect = completedWork;// } else {// returnFiber.firstEffect = completedWork;// }// returnFiber.lastEffect = completedWork;effectFiberList.push(completedWork);}//....completedWork=returnFiber;// Update the next thing we're working on in case something throws.workInProgress=completedWork;}while(completedWork!==null);// We've reached the root.}
The text was updated successfully, but these errors were encountered:
This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please create a new issue with up-to-date information. Thank you!
Hello,i'm curious why React17 uses a linked list on finishedWork tree instead of using an array to hold fiber nodes with side effects. It seems that it is easier to understand with arrays. Thank you for your answer
The text was updated successfully, but these errors were encountered: