Do not use try / catch blocks here as the video shows. You need the promise to be fulfilled or rejected which will have the appropriate response in the extraReducers.
Description:
Learn how to implement async actions using Redux Thunk middleware and Axios in Redux Toolkit. Explore the concept of thunks, create async thunks for fetching posts and users, and build a PostsExcerpt component. Discover how to handle loading states, dispatch async thunks at app load time, and create an addNewPost async thunk. Gain insights into adjusting initial state, adding extraReducers with builder cases, and avoiding common pitfalls when working with promises in Redux.
React Redux Thunk Middleware in Redux Toolkit for Async Actions with Axios