-
Notifications
You must be signed in to change notification settings - Fork 342
Closed
Labels
misalignmentMisalign with the latest RFCMisalign with the latest RFC
Description
My latest PHPStorm version complains because in your index.d.ts is the following code
declare const onBeforeMount: (callback: Function) => void;
declare const onMounted: (callback: Function) => void;
declare const onBeforeUpdate: (callback: Function) => void;
declare const onUpdated: (callback: Function) => void;
declare const onBeforeUnmount: (callback: Function) => void;
declare const onUnmounted: (callback: Function) => void;
declare const onErrorCaptured: (callback: Function) => void;
declare const onActivated: (callback: Function) => void;
declare const onDeactivated: (callback: Function) => void;
declare const onServerPrefetch: (callback: Function) => void;
So my IDE thinks
// unMounted is void
const unMounted = onBeforeUnmount(() => {
// do something
});
Is there a way without using Typescript or ignoring the error via IDE settings to fix that? (I know it's not a real error but it looks ugly and I don't just want to surpass all IDE warnings)
When I take a look at the Vue 3 implementation they indeed return something
export declare const onBeforeMount: (hook: () => any, target?: ComponentInternalInstance | null) => false | Function | undefined;
export declare const onBeforeUnmount: (hook: () => any, target?: ComponentInternalInstance | null) => false | Function | undefined;
export declare const onBeforeUpdate: (hook: () => any, target?: ComponentInternalInstance | null) => false | Function | undefined;
Metadata
Metadata
Assignees
Labels
misalignmentMisalign with the latest RFCMisalign with the latest RFC