StackShareStackShare
Follow on
StackShare

Discover and share technology stacks from companies around the world.

Follow on

© 2025 StackShare. All rights reserved.

Product

  • Stacks
  • Tools
  • Feed

Company

  • About
  • Contact

Legal

  • Privacy Policy
  • Terms of Service
  1. Stackups
  2. Application & Data
  3. Frameworks
  4. State Management Library
  5. Redux vs redux-thunk

Redux vs redux-thunk

OverviewComparisonAlternatives

Overview

Redux
Redux
Stacks32.0K
Followers23.6K
Votes674
redux-thunk
redux-thunk
Stacks1.2K
Followers185
Votes6
GitHub Stars17.7K
Forks1.0K

Redux vs redux-thunk: What are the differences?

Introduction

In this Markdown document, we will discuss the key differences between Redux and redux-thunk, two popular JavaScript libraries used in web development.

  1. Store Management Approach: Redux is a predictable state container, while redux-thunk is a middleware that allows handling of asynchronous actions in Redux. Redux follows a strict unidirectional data flow, where actions trigger state changes through reducers and the changes are propagated to the components. On the other hand, redux-thunk allows the use of asynchronous actions by intercepting dispatched actions and delaying their execution, making it easier to handle side effects like API calls.

  2. Action Structure and Behavior: Redux actions are usually plain JavaScript objects with a type property and optional payload. These actions are dispatched directly to the store, which triggers the corresponding state changes. In contrast, redux-thunk actions can be functions that dispatch regular actions asynchronously. These thunk actions have access to the store's dispatch and getState methods, allowing them to dispatch regular actions based on certain conditions or perform other tasks before dispatching.

  3. Middleware Integration: Redux does not require any additional middleware to work properly, but it can be enhanced with middleware like redux-logger or redux-thunk. Redux-thunk, on the other hand, is a middleware itself and needs to be explicitly integrated into Redux by using the applyMiddleware function from the Redux library. This allows Redux to process the thunk actions and handle the asynchronous behavior.

  4. Ease of Use: Redux is relatively simple and straightforward, making it easier for developers to understand and implement. It follows a minimalistic approach with a single store and pure functions as reducers, promoting a more predictable and testable codebase. Redux-thunk, while not overly complex, adds an extra layer of abstraction with thunk actions and middleware setup. This can slightly increase the learning curve and boilerplate code, especially for beginners or smaller projects.

  5. Testing: Testing Redux applications can be easier due to its pure functions and predictable data flow. Reducers can be tested by passing different actions and asserting the resulting state changes. Similarly, action creators can be tested by directly invoking them with different inputs. However, testing redux-thunk actions requires additional setup using a tool like redux-mock-store to mock the store and simulate the dispatch behavior. This adds complexity to the testing process, making it slightly more cumbersome compared to testing pure Redux code.

  6. Community and Ecosystem: Redux has gained significant popularity over the years and has a large and active community. It is widely adopted and has an extensive ecosystem of third-party libraries, tools, and resources to support developers. Redux-thunk, being an extension of Redux, benefits from the same community and ecosystem. However, it is worth noting that there are other alternatives to redux-thunk, such as redux-saga or redux-promise, which offer different approaches to handling asynchronous actions in Redux.

In summary, Redux is a predictable state container, while redux-thunk is a middleware that enables handling of asynchronous actions in Redux. Redux follows a strict unidirectional data flow, while redux-thunk adds an extra layer of abstraction with thunk actions and middleware setup. Redux has a simpler and more minimalistic approach, making it easier to understand and implement. Testing Redux applications can be easier compared to testing redux-thunk actions. Both Redux and redux-thunk benefit from a large and active community.

Share your Stack

Help developers discover the tools you use. Get visibility for your team's tech choices and contribute to the community's knowledge.

View Docs
CLI (Node.js)
or
Manual

Detailed Comparison

Redux
Redux
redux-thunk
redux-thunk

It helps you write applications that behave consistently, run in different environments (client, server, and native), and are easy to test. t provides a great experience, such as live code editing combined with a time traveling debugger.

Redux Thunk middleware allows you to write action creators that return a function instead of an action. The thunk can be used to delay the dispatch of an action, or to dispatch only if a certain condition is met. The inner function receives the store methods dispatch and getState as parameters.

Predictable state; Easy testing; Works with other view layers besides React
-
Statistics
GitHub Stars
-
GitHub Stars
17.7K
GitHub Forks
-
GitHub Forks
1.0K
Stacks
32.0K
Stacks
1.2K
Followers
23.6K
Followers
185
Votes
674
Votes
6
Pros & Cons
Pros
  • 191
    State is predictable
  • 150
    Plays well with React and others
  • 126
    State stored in a single object tree
  • 79
    Hot reloading out of the box
  • 74
    Allows for time travel
Cons
  • 13
    Lots of boilerplate
  • 6
    Verbose
  • 5
    Design
  • 5
    Steep learning curve
  • 4
    Steeper learning curve than MobX
Pros
  • 6
    Easy
Integrations
JavaScript
JavaScript
React
React
No integrations available

What are some alternatives to Redux, redux-thunk?

MobX

MobX

MobX is a battle tested library that makes state management simple and scalable by transparently applying functional reactive programming (TFRP). React and MobX together are a powerful combination. React renders the application state by providing mechanisms to translate it into a tree of renderable components. MobX provides the mechanism to store and update the application state that React then uses.

Zustand

Zustand

Small, fast and scaleable bearbones state-management solution. Has a comfy api based on hooks, that isn't boilerplatey or opinionated, but still just enough to be explicit and flux-like.

Effector

Effector

It is an effective multi-store state manager for Javascript apps, that allows you to manage data in complex applications.

redux-saga

redux-saga

An alternative side effect model for Redux apps

vuex

vuex

Vuex is a state management pattern + library for Vue.js applications. It serves as a centralized store for all the components in an application, with rules ensuring that the state can only be mutated in a predictable fashion. It also integrates with Vue's official devtools extension to provide advanced features such as zero-config time-travel debugging and state snapshot export / import.

Unstated

Unstated

State so simple, it goes without saying

reselect

reselect

Simple “selector” library for Redux (and others) inspired by getters in NuclearJS, subscriptions in re-frame and this proposal from speedskater.

Redux Observable

Redux Observable

It allows developers to dispatch a function that returns an observable, promise or iterable of action(s). Compose and cancel async actions to create side effects and more.

Recoiljs

Recoiljs

It is an experimental state management library for React apps. It provides several capabilities that are difficult to achieve with React alone, while being compatible with the newest features of React.

XState

XState

It is a library for creating, interpreting, and executing finite state machines and statecharts. It's a really powerful package that can be used to manage state in React Apps.

Related Comparisons

Bootstrap
Materialize

Bootstrap vs Materialize

Laravel
Django

Django vs Laravel vs Node.js

Bootstrap
Foundation

Bootstrap vs Foundation vs Material UI

Node.js
Spring Boot

Node.js vs Spring-Boot

Liquibase
Flyway

Flyway vs Liquibase