createAsyncThunk
Valdi skips the JavaScript runtime by compiling TypeScript to native views. Learn how it compares to React Native’s new architecture and when the trade-off makes sense.

What trends will define web development in 2026? Check out the eight most important trends of the year, from AI-first development to TypeScript’s takeover.

AI-first debugging augments traditional debugging with log clustering, pattern recognition, and faster root cause analysis. Learn where AI helps, where it fails, and how to use it safely in production.

Container queries let components respond to their own layout context instead of the viewport. This article explores how they work and where they fit alongside media queries.
Would you be interested in joining LogRocket's developer community?
Join LogRocket’s Content Advisory Board. You’ll help inform the type of content we create and get access to exclusive meetups, social accreditation, and swag.
Sign up now
7 Replies to "Using Redux Toolkit’s <code>createAsyncThunk</code>"
Thanks so much
You just saved me man
Thanks a lot
You’re welcome man. Glad I could help (:
While you correctly describe the payloadCreator as the second parameter of the async request, your use of the pseudocode “async (thunkAPI)” misleadingly may guide a reader into believing the thunkAPI is first parameter. (I certainly was fooled.) Perhaps clearer pseudocode would be “async (_, thunkAPI)”?
While redux might be a hard topic to understand, you made it easy to understand.
Good afternoon!
Excellent article, I learned a lot, but I didn’t understand how you use the getPosts function and you didn’t export it from the file, where am I going wrong?
You forgot an “export” in front of the definition of the getPosts createAsyncThunk. That’s how you can run it as a function within the dispatch() operation.
I thought I had a fundamental misunderstanding of Redux for a second there. Finally figured out it was a typo when I checked out the official docs.
https://redux-toolkit.js.org/api/createAsyncThunk
We’ve now fixed this typo — thanks for catching that, Jared!