We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1403bce commit 6642102Copy full SHA for 6642102
packages/runtime-core/src/apiLifecycle.ts
@@ -84,16 +84,16 @@ export const onRenderTracked = createHook<DebuggerHook>(
84
LifecycleHooks.RENDER_TRACKED
85
)
86
87
-export type ErrorCapturedHook = (
88
- err: unknown,
+export type ErrorCapturedHook<TError = unknown> = (
+ err: TError,
89
instance: ComponentPublicInstance | null,
90
info: string
91
) => boolean | void
92
93
-export const onErrorCaptured = (
94
- hook: ErrorCapturedHook,
+export function onErrorCaptured<TError = Error>(
+ hook: ErrorCapturedHook<TError>,
95
target: ComponentInternalInstance | null = currentInstance
96
-) => {
+) {
97
injectHook(LifecycleHooks.ERROR_CAPTURED, hook, target)
98
}
99
0 commit comments