createAsyncThunk
Learn how ChatGPT’s new browser Atlas fits into a frontend developer’s toolkit, including the debugging and testing process.

Users don’t think in terms of frontend or backend; they just see features. This article explores why composition, not reactivity, is becoming the core organizing idea in modern UI architecture.

Discover what’s new in The Replay, LogRocket’s newsletter for dev and engineering leaders, in the November 19th issue.

Jack Herrington writes about how React 19.2 rebuilds async handling from the ground up with use(),
Hey there, want to help make our blog better?
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!