TS2345 error while putting thunk actions
qkudev opened this issue · comments
Steps to reproduce
Create any thunk action and try to put
/putResolve
it. Type checks will fail with error TS2345
because put
and putResolve
both expect to get plain object actions, not thunk actions.
Description of the bug/issue
put
and putResolve
both expect plain object actions, not thunk actions.
Create any thunk action and try to put
/putResolve
it. TypeScript compiler will break with error because put
and putResolve
are expected to get plain object action, not thunk action.
Steps to reproduce the bug/issue
- Create any thunk action
- Try to
put
orputResolve
it in saga - Get the TS error
But if use putResolve<any>
the saga will work well.
Example
Checkout this example (makeStore.ts
file)
Actual results
Getting the TS2345
error
The Expected results
Everything is ok with type checks
Environment information
redux-saga v1.2.3
@reduxjs/toolkit v1.9.3
typescript v4.4.2