Skip to content

Commit ae4fc54

Browse files
committed
Fix TS 5.4 issue related to dispatch
1 parent 6f3900d commit ae4fc54

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/toolkit/src/createAsyncThunk.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ export const createAsyncThunk = /* @__PURE__ */ (() => {
617617
}
618618
abortController.signal.addEventListener('abort', abortHandler)
619619
})
620-
dispatch(
620+
;(dispatch as ThunkDispatch<unknown, unknown, UnknownAction>)(
621621
pending(
622622
requestId,
623623
arg,
@@ -679,7 +679,9 @@ export const createAsyncThunk = /* @__PURE__ */ (() => {
679679
(finalAction as any).meta.condition
680680

681681
if (!skipDispatch) {
682-
dispatch(finalAction as any)
682+
;(dispatch as ThunkDispatch<unknown, unknown, UnknownAction>)(
683+
finalAction as any,
684+
)
683685
}
684686
return finalAction
685687
})()

0 commit comments

Comments
 (0)