mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
DevTools temporarily disable prepareStackTrace before creating custom component stacks (#18717)
This commit is contained in:
@@ -80,6 +80,10 @@ export function describeNativeComponentFrame(
|
||||
|
||||
let control;
|
||||
|
||||
const previousPrepareStackTrace = Error.prepareStackTrace;
|
||||
// $FlowFixMe It does accept undefined.
|
||||
Error.prepareStackTrace = undefined;
|
||||
|
||||
reentry = true;
|
||||
let previousDispatcher;
|
||||
if (__DEV__) {
|
||||
@@ -181,6 +185,9 @@ export function describeNativeComponentFrame(
|
||||
}
|
||||
} finally {
|
||||
reentry = false;
|
||||
|
||||
Error.prepareStackTrace = previousPrepareStackTrace;
|
||||
|
||||
if (__DEV__) {
|
||||
currentDispatcherRef.current = previousDispatcher;
|
||||
reenableLogs();
|
||||
|
||||
Reference in New Issue
Block a user