Actions must be plain objects ⚛️ React

Error: Actions must be plain objects. Instead, the actual type was: 'function'.

A function (thunk) was dispatched but the thunk middleware isn’t configured.

Seen on: React

Meaning

Plain Redux only accepts object actions. Redux Toolkit’s configureStore includes thunk by default; hand-made createStore setups need applyMiddleware(thunk).

Common causes

  • Thunk middleware missing
  • Custom middleware replacing defaults in configureStore
  • Dispatching an action creator without calling it

⚡ Quick fix

  1. Use Redux Toolkit configureStore (thunk included)
  2. When customizing middleware use getDefaultMiddleware().concat(...)
  3. Dispatch action objects: dispatch(addTodo(text))

Detailed fix by platform

React

  1. configureStore({ reducer, middleware: getDefault => getDefault().concat(logger) })

How to diagnose

  1. Middleware — Is thunk included?
  2. Dispatch — What value is dispatched?

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.