MCPcopy Create free account
hub / github.com/BetaSu/big-react / throwAndUnwindWorkLoop

Function throwAndUnwindWorkLoop

packages/react-reconciler/src/workLoop.ts:452–462  ·  view source on GitHub ↗
(
	root: FiberRootNode,
	unitOfWork: FiberNode,
	thrownValue: any,
	lane: Lane
)

Source from the content-addressed store, hash-verified

450}
451
452function throwAndUnwindWorkLoop(
453 root: FiberRootNode,
454 unitOfWork: FiberNode,
455 thrownValue: any,
456 lane: Lane
457) {
458 // unwind前的重置hook,避免 hook0 use hook1 时 use造成中断,再恢复时前后hook对应不上
459 resetHooksOnUnwind(unitOfWork);
460 throwException(root, thrownValue, lane);
461 unwindUnitOfWork(unitOfWork);
462}
463
464function unwindUnitOfWork(unitOfWork: FiberNode) {
465 let incompleteWork: FiberNode | null = unitOfWork;

Callers 1

renderRootFunction · 0.85

Calls 3

resetHooksOnUnwindFunction · 0.90
throwExceptionFunction · 0.90
unwindUnitOfWorkFunction · 0.85

Tested by

no test coverage detected