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 followed the instructions of defining a pre typed async thunk to use the new createAsynkThunk.withTypes<AsyncThunkConfig>() in order to have types available in my slices.
Expected behaviour:
I expected to be able to access the ThunkApi properties defined in the AsynkThunkConfig in my created async thunks.
Current behaviour:
The types are correctly inferred but the action creators are not being created and I receive the following error when I use the newly created createAppAsyncThunk function.
Error Message:
Firefox
Message: can't access property "type", typeOrActionCreator is undefined
Error in @reduxjs/toolkit@1.9.0/dist/redux-toolkit.cjs.development.js (607:24)
Chrome
Message: Cannot read properties of undefined (reading 'type')
Error in @reduxjs/toolkit@1.9.0/dist/redux-toolkit.cjs.development.js (607:108)
The text was updated successfully, but these errors were encountered:
gitChaoslord
changed the title
Possible bug: typeActionCreator is undefined for createAsyncThunk.withTypes
typeActionCreator is undefined for createAsyncThunk.withTypes
Nov 8, 2022
Description:
I followed the instructions of defining a pre typed async thunk to use the new
createAsynkThunk.withTypes<AsyncThunkConfig>()
in order to have types available in my slices.Expected behaviour:
I expected to be able to access the ThunkApi properties defined in the AsynkThunkConfig in my created async thunks.
Current behaviour:
The types are correctly inferred but the action creators are not being created and I receive the following error when I use the newly created
createAppAsyncThunk
function.Error Message:
Here is a Stackblitz with my issue: https://stackblitz.com/edit/react-ts-jdymnd?file=store%2Ffeatures%2Fslice.ts
Other Information:
RTK version 1.9.0
Typescript: 4.8.4
React 18.2.0
React-redux 8.0.5
Redux 4.20
The text was updated successfully, but these errors were encountered: