Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unknown[] type of arguments for history methods #50

Closed
faminchik opened this issue Nov 12, 2021 · 4 comments
Closed

unknown[] type of arguments for history methods #50

faminchik opened this issue Nov 12, 2021 · 4 comments

Comments

@faminchik
Copy link

push, replace, go, goBack, goForward history methods have unknown[] type for arguments.

image

@salvoravida
Copy link
Owner

@faminchik please upgrade to 5.x it should be fixed

@salvoravida
Copy link
Owner

@faminchik lmk if it solves your issue

@faminchik
Copy link
Author

faminchik commented Nov 13, 2021

@salvoravida

Hello Salvatore,

I've installed redux-first-history v5.0.1 and history v5.1.0, but this issue still exists


If take a look at the actions.d.ts file, I see the following:

export declare const push: (...args: Parameters<History[HistoryMethods]>) => ReduxAction;
export declare const replace: (...args: Parameters<History[HistoryMethods]>) => ReduxAction;
export declare const go: (...args: Parameters<History[HistoryMethods]>) => ReduxAction;
export declare const goBack: (...args: Parameters<History[HistoryMethods]>) => ReduxAction;
export declare const goForward: (...args: Parameters<History[HistoryMethods]>) => ReduxAction;

export declare type HistoryMethods = 'push' | 'replace' | 'go' | 'goBack' | 'goForward';

And since all these five methods have nothing in common, then args have unknown[] type.

I guess the reason is in the following function.

@salvoravida
Copy link
Owner

@salvoravida

Hello Salvatore,

I've installed redux-first-history v5.0.1 and history v5.1.0, but this issue still exists

If take a look at the actions.d.ts file, I see the following:

export declare const push: (...args: Parameters<History[HistoryMethods]>) => ReduxAction;
export declare const replace: (...args: Parameters<History[HistoryMethods]>) => ReduxAction;
export declare const go: (...args: Parameters<History[HistoryMethods]>) => ReduxAction;
export declare const goBack: (...args: Parameters<History[HistoryMethods]>) => ReduxAction;
export declare const goForward: (...args: Parameters<History[HistoryMethods]>) => ReduxAction;

export declare type HistoryMethods = 'push' | 'replace' | 'go' | 'goBack' | 'goForward';

And since all these five methods have nothing in common, then args have unknown[] type.

I guess the reason is in the following function.

Please try 5.0.2. Can you create a codesandbox?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants