imliam / vscode-inline-parameters

An extension for Visual Studio Code that adds inline parameter annotations when calling a function.
https://marketplace.visualstudio.com/items?itemName=liamhammett.inline-parameters
MIT License
197 stars 21 forks source link

Wrong parameter name React.useCallback typescript #42

Open t-ricci-enhancers opened 3 years ago

t-ricci-enhancers commented 3 years ago

This parameter name should only be "callback" instead it's shown the TypeScript typings of the function.

Screen Shot 2021-03-11 at 09 35 57

This is React.useCallback TypeScript declaration:

function useCallback<T extends (...args: any[]) => any>(callback: T, deps: DependencyList): T;
t-ricci-enhancers commented 3 years ago

A similar issue with React.memo first parameter:

Screen Shot 2021-03-11 at 10 47 57

TypeScript declaration:

function memo<P extends object>(
        Component: SFC<P>,
        propsAreEqual?: (prevProps: Readonly<PropsWithChildren<P>>, nextProps: Readonly<PropsWithChildren<P>>) => boolean
    ): NamedExoticComponent<P>;
    function memo<T extends ComponentType<any>>(
        Component: T,
        propsAreEqual?: (prevProps: Readonly<ComponentProps<T>>, nextProps: Readonly<ComponentProps<T>>) => boolean
    ): MemoExoticComponent<T>;