DevTools temporarily disable prepareStackTrace before creating custom component stacks (#18717)

This commit is contained in:
Brian Vaughn
2020-04-23 09:02:42 -07:00
committed by GitHub
parent b0cb137bcb
commit b9fc3d8d59
2 changed files with 54 additions and 0 deletions
@@ -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();