Ask questions about any GitHub repository
Instant semantic search and code reasoning for your entire codebase. Answers grounded in the actual files, with citations you can check.
Try it with
facebook/react
How does the React reconciliation algorithm handle fiber node updates in the current version?
In packages/react-reconciler/src/ReactFiberBeginWork.js, the reconciliation logic is distributed across several key functions. When an update is triggered, React creates a new fiber node (the "work-in-progress" fiber) using the createWorkInProgress function.
ReactFiberBeginWork.js
function beginWork(current, workInProgress, renderLanes) {
// Check for recurring updates
if (current !== null) {
const oldProps = current.memoizedProps;
const newProps = workInProgress.pendingProps;
if (oldProps !== newProps || hasContextChanged()) {
// Mark as having changed props or context
didReceiveUpdate = true;
}
}
}ReactFiber.jsReactChildFiber.js