MCPcopy Create free account
hub / github.com/QuarkGluonPlasma/react-course-code / performUnitOfWork

Function performUnitOfWork

mini-react/src/mini-react.js:62–79  ·  view source on GitHub ↗
(fiber)

Source from the content-addressed store, hash-verified

60 requestIdleCallback(workLoop)
61
62 function performUnitOfWork(fiber) {
63 const isFunctionComponent = fiber.type instanceof Function
64 if (isFunctionComponent) {
65 updateFunctionComponent(fiber)
66 } else {
67 updateHostComponent(fiber)
68 }
69 if (fiber.child) {
70 return fiber.child
71 }
72 let nextFiber = fiber
73 while (nextFiber) {
74 if (nextFiber.sibling) {
75 return nextFiber.sibling
76 }
77 nextFiber = nextFiber.return
78 }
79 }
80
81 let wipFiber = null
82 let stateHookIndex = null

Callers 1

workLoopFunction · 0.85

Calls 2

updateFunctionComponentFunction · 0.85
updateHostComponentFunction · 0.85

Tested by

no test coverage detected