You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am encountering several Type errors when use router actions from connected-react-router. Someone else already made an issue over at connected-react-router. But I believe it to be an issue with the ActionType, since this is being used to type the epics. It still works but it throws an error.
This is the full output from Typescript, it's always pretty similar.
Overload 1 of 20, '(...args: (SchedulerLike | CallHistoryMethodAction<[string, PoorMansUnknown?]>)[]): Observable<CallHistoryMethodAction<[string, PoorMansUnknown?]>>', gave the following error.
Argument of type 'PayloadAction<PlaylistActionTypes.SEARCH, { query?: string | null | undefined; tag?: string | undefined; refresh: boolean; } & PlaylistIdentifier>' is not assignable to parameter of type 'SchedulerLike | CallHistoryMethodAction<[string, PoorMansUnknown?]>'.
Type 'PayloadAction<PlaylistActionTypes.SEARCH, { query?: string | null | undefined; tag?: string | undefined; refresh: boolean; } & PlaylistIdentifier>' is not assignable to type 'CallHistoryMethodAction<[string, PoorMansUnknown?]>'.
Types of property 'type' are incompatible.
Type 'PlaylistActionTypes.SEARCH' is not assignable to type '"@@router/CALL_HISTORY_METHOD"'.
Overload 2 of 20, '(...args: CallHistoryMethodAction<[string, PoorMansUnknown?]>[]): Observable<CallHistoryMethodAction<[string, PoorMansUnknown?]>>', gave the following error.
Argument of type 'PayloadAction<PlaylistActionTypes.SEARCH, { query?: string | null | undefined; tag?: string | undefined; refresh: boolean; } & PlaylistIdentifier>' is not assignable to parameter of type 'CallHistoryMethodAction<[string, PoorMansUnknown?]>'.ts(2769)
Mandatory info
Are you extending internal types to enable type-free syntax with createReducer?
// If yes PASTE HERE your types.d.tsdeclare module 'typesafe-actions'{interfaceTypes{RootAction: RootAction;}}
Description
I am encountering several Type errors when use router actions from
connected-react-router
. Someone else already made an issue over atconnected-react-router
. But I believe it to be an issue with theActionType
, since this is being used to type the epics. It still works but it throws an error.This is the full output from Typescript, it's always pretty similar.
Mandatory info
createReducer
?How to Reproduce
CodeSandbox Link
https://codesandbox.io/s/react-redux-typescript-realworld-app-4c0fj
Please check the
loadDataOnAppStart
.Expected behavior
Adding routeractions in Epics should not throw any errors.
Suggested solution(s)
Project Dependencies
These are my dependencies, not the one in the sandbox. But it has similar behavior.
tsconfig.json
Environment (optional)
The text was updated successfully, but these errors were encountered: