-
-
Couldn't load subscription status.
- Fork 1.2k
Closed
Description
Working on a regular JS project in VSCode which uses Typescript to check the files, using createAsyncThunk with an argument causes type errors:
export const addPost = createAsyncThunk("posts/addPost", async post => {});
// somewhere else...
dispatch(addPost(post))Type error: Expected 0 arguments, but got 1
I understand that the argument in the payloadCreator is typed as void by default and if this was a regular TS project, I could've easily added a type for the post or even typed it as any, but seeing as that is not possible, I would be grateful for a JS solution. I don't seem to be able to extend types either.
Metadata
Metadata
Assignees
Labels
No labels