Commit 910a4261 authored by Jiachi Liu's avatar Jiachi Liu

revert unnecessary change

parent ca1e1c7d
...@@ -15,16 +15,7 @@ export function coerceError(value: unknown): Error { ...@@ -15,16 +15,7 @@ export function coerceError(value: unknown): Error {
} }
export function setOwnerStackIfAvailable(error: Error): void { export function setOwnerStackIfAvailable(error: Error): void {
// React 18 and prod does not have `captureOwnerStack` setOwnerStack(error, React.captureOwnerStack())
if ('captureOwnerStack' in React) {
const ownerStack = React.captureOwnerStack()
// Only set if we captured a valid owner stack, or if none exists yet.
// This prevents overwriting a valid owner stack captured earlier
// (e.g., in onRecoverableError) with null captured later.
if (ownerStack || !ownerStacks.has(error)) {
setOwnerStack(error, ownerStack)
}
}
} }
export function decorateDevError(thrownValue: unknown) { export function decorateDevError(thrownValue: unknown) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment