(root: FiberRoot, error: mixed)
| 3255 | } |
| 3256 | |
| 3257 | function panicOnRootError(root: FiberRoot, error: mixed) { |
| 3258 | // There's no ancestor that can handle this exception. This should never |
| 3259 | // happen because the root is supposed to capture all errors that weren't |
| 3260 | // caught by an error boundary. This is a fatal error, or panic condition, |
| 3261 | // because we've run out of ways to recover. |
| 3262 | workInProgressRootExitStatus = RootFatalErrored; |
| 3263 | logUncaughtError(root, createCapturedValueAtFiber(error, root.current)); |
| 3264 | // Set `workInProgress` to null. This represents advancing to the next |
| 3265 | // sibling, or the parent if there are no siblings. But since the root |
| 3266 | // has no siblings nor a parent, we set it to null. Usually this is |
| 3267 | // handled by `completeUnitOfWork` or `unwindWork`, but since we're |
| 3268 | // intentionally not calling those, we need set it here. |
| 3269 | // TODO: Consider calling `unwindWork` to pop the contexts. |
| 3270 | workInProgress = null; |
| 3271 | } |
| 3272 | |
| 3273 | function completeUnitOfWork(unitOfWork: Fiber): void { |
| 3274 | // Attempt to complete the current unit of work, then move to the next |
no test coverage detected