( root: FiberRoot, errorInfo: CapturedValue<mixed>, lane: Lane, )
| 89 | import {callComponentDidCatchInDEV} from './ReactFiberCallUserSpace'; |
| 90 | |
| 91 | function createRootErrorUpdate( |
| 92 | root: FiberRoot, |
| 93 | errorInfo: CapturedValue<mixed>, |
| 94 | lane: Lane, |
| 95 | ): Update<mixed> { |
| 96 | const update = createUpdate(lane); |
| 97 | // Unmount the root by rendering null. |
| 98 | update.tag = CaptureUpdate; |
| 99 | // Caution: React DevTools currently depends on this property |
| 100 | // being called "element". |
| 101 | update.payload = {element: null}; |
| 102 | update.callback = () => { |
| 103 | if (__DEV__) { |
| 104 | runWithFiberInDEV(errorInfo.source, logUncaughtError, root, errorInfo); |
| 105 | } else { |
| 106 | logUncaughtError(root, errorInfo); |
| 107 | } |
| 108 | }; |
| 109 | return update; |
| 110 | } |
| 111 | |
| 112 | function createClassErrorUpdate(lane: Lane): Update<mixed> { |
| 113 | const update = createUpdate(lane); |
no test coverage detected