-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
typeActionCreator is undefined for createAsyncThunk.withTypes #2884
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Milestone
Comments
Yes, it appears that we lied to TypeScript and are returning a thunk function, not This is a bug and we ought to fix it ASAP. |
Could you please try the build of #2885? |
Also found out that |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: