File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed
packages/react-reconciler/src Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -2196,6 +2196,14 @@ export function captureCommitPhaseError(
21962196 nearestMountedAncestor : Fiber | null ,
21972197 error : mixed ,
21982198) {
2199+ if ( __DEV__ ) {
2200+ // Commit phase doesn't use invokeGuardedCallback anymore due to perf.
2201+ // However, we still want to print the message and make it fire onerror.
2202+ invokeGuardedCallback ( null , ( ) => {
2203+ throw error ;
2204+ } ) ;
2205+ }
2206+
21992207 if ( sourceFiber . tag === HostRoot ) {
22002208 // Error was thrown at the root. There is no parent, so the root
22012209 // itself should capture it.
Original file line number Diff line number Diff line change @@ -2196,6 +2196,14 @@ export function captureCommitPhaseError(
21962196 nearestMountedAncestor : Fiber | null ,
21972197 error : mixed ,
21982198) {
2199+ if ( __DEV__ ) {
2200+ // Commit phase doesn't use invokeGuardedCallback anymore due to perf.
2201+ // However, we still want to print the message and make it fire onerror.
2202+ invokeGuardedCallback ( null , ( ) => {
2203+ throw error ;
2204+ } ) ;
2205+ }
2206+
21992207 if ( sourceFiber . tag === HostRoot ) {
22002208 // Error was thrown at the root. There is no parent, so the root
22012209 // itself should capture it.
You can’t perform that action at this time.
0 commit comments