# Redux

> A JavaScript tool that keeps an app's shared data in one store. It changes by actions.

**Field:** Software Development  
**Category:** Web Development  
**Also known as:** Redux Toolkit, Redux JS, RTK

## Think of it like

It is like a bank. You never change the money yourself. You hand in a slip, and the bank does it.

## Definition

Redux is a free JavaScript library for keeping an app's shared state in one store. Parts of the app never change the store directly. They send an action, a small note that says what happened. A function called a reducer reads the action and makes the new state. Because every change goes through one path, it is easy to follow. Redux Toolkit is the official way to write it today.

## Example

Jack's app has a bug where the cart empties. Redux's tools show every action in order, so he finds the one that did it.

## Example code

```javascript
dispatch({ type: "cart/addItem", payload: { id: 7 } });
```

Parts of the app send an action like this. The reducer then makes the new state.

## Why it matters

Big apps with lots of shared data stay easy to follow. Every change is written down as an action.

## Common mistake

Adding Redux to a small app that does not need it. Plain component state is often enough.

## Three principles

- **One store.** All shared state in one place.
- **Actions only.** Changes come as small notes.
- **Reducers decide.** A function makes the new state.

## Related terms

- [State Management](https://learn.benibix.com/term/development/state-management)
- [React](https://learn.benibix.com/term/development/react)
- [JavaScript](https://learn.benibix.com/term/development/javascript)
- [UI State](https://learn.benibix.com/term/development/state)

![A store box in the middle holds the app state, such as the user and the cart. Three components read from it: a header, a cart badge and a checkout page. The checkout page sends an action, add item, to the store, and the store passes the new state back to all three at once.](https://learn.benibix.com/diagrams/dev5-state-store.svg)

---

Source: https://learn.benibix.com/term/development/redux
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
