File tree 2 files changed +16
-0
lines changed
packages/react-reconciler/src 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -2196,6 +2196,14 @@ export function captureCommitPhaseError(
2196
2196
nearestMountedAncestor : Fiber | null ,
2197
2197
error : mixed ,
2198
2198
) {
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
+
2199
2207
if ( sourceFiber . tag === HostRoot ) {
2200
2208
// Error was thrown at the root. There is no parent, so the root
2201
2209
// itself should capture it.
Original file line number Diff line number Diff line change @@ -2196,6 +2196,14 @@ export function captureCommitPhaseError(
2196
2196
nearestMountedAncestor : Fiber | null ,
2197
2197
error : mixed ,
2198
2198
) {
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
+
2199
2207
if ( sourceFiber . tag === HostRoot ) {
2200
2208
// Error was thrown at the root. There is no parent, so the root
2201
2209
// itself should capture it.
You can’t perform that action at this time.
0 commit comments