Redux Toolkit Cheat Sheet

Last Updated: November 21, 2025

Core APIs

API Purpose
createSlice Define reducer + actions
configureStore Set up middleware + devtools
createAsyncThunk Handle async logic + pending/fulfilled states

Common Commands

slice.actions
Dispatch generated actions
dispatch(fetchUser())
Trigger thunk from component
store.getState()
Read current state for selectors

Tips

Co-locate thunks with slices, avoid storing normalized data twice, and use `createEntityAdapter` for collections.

💡 Pro Tip: Create slices and use `createAsyncThunk` rather than manual action/reducer boilerplate.
← Back to Databases & APIs | Browse all categories | View all cheat sheets