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

**Code:** `Actions must be plain objects` · **Category:** React · **Seen on:** React

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

## 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?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/react/redux-actions-must-be-plain-objects)
