Support `history` 5 types
flying-sheep opened this issue · 2 comments
flying-sheep commented
history
5.1 renamed the type LocationDescriptor
to To
. Since this project’s push
and replace
are typed like the following, their location
argument is now typed as any
. Current typing:
export declare const push: (location: import("history").LocationDescriptor<unknown>) => ReduxAction;
I think it can be fixed like this:
import { History, Location, Action } from 'history'
import { AnyAction as ReduxAction } from 'redux'
[...]
type To = Parameters<History['push']>[0]
declare const push: (to: To) => ReduxAction
[...]
salvoravida commented
flying-sheep commented
works wonderfully! Thank you 😄