Redux is a state container for JavaScript apps.
- Official website:
devarchy.com/redux
- Use devarchy to add a library to the catalog
- Code Architecture
- Utilities
- Code Style
- Dev tools / Inspection tools
- React Integration
- Other Integrations
- Boilerplate
- Miscellaneous
- Learning Material
- Community
Aims to improve the overall structure of the source code. Makes reasoning about the code easier.
- redux-schema - Automatic actions, reducers and validation for Redux.
- redux-tcomb - Immutable and type-checked state and actions for Redux.
- redux-action-tree - The Cerebral signals running with Redux.
- redux-elm - The Elm Architecture in JavaScript.
- redux-orm - Small, simple and immutable ORM to manage relational data in your Redux store.
- redux-api-middleware - Redux middleware for calling an API.
- redux-ignore - Higher-order reducer to ignore Redux actions.
- redux-modifiers - Collection of generic functions for writing Redux reducers to operate on various data structures.
- rereduce - Reducer library for Redux.
- redux-search - Redux bindings for client-side search.
- redux-logger - Logger middleware for Redux.
- redux-immutable - Redux-immutable is used to create an equivalent function of Redux combineReducers that works with Immutable.js state.
- reselect - Selector library for Redux.
- redux-requests - Manages in-flight requests with a Redux reducer to avoid issuing duplicate requests.
- redux-undo - Higher order reducer to add undo/redo functionality to Redux state containers.
- redux-bug-reporter - Bug reporter and bug playback tool for Redux.
- redux-transducers - Transducer utilities for Redux.
- redux-storage - Persistence layer for Redux with flexible backends.
- redux-persist - Persist and rehydrate a Redux store.
Side Effects / Asynchronous Actions
- redux-saga - Alternative side effect model for Redux apps.
- redux-promise-middleware - Redux middleware for resolving and rejecting promises with conditional optimistic updates.
- redux-effects - You write pure functions, redux-effects handles the rest.
- redux-thunk - Thunk middleware for Redux.
- redux-connect - Provides decorator for resolving async props in react-router, extremely useful for handling server-side rendering in React.
- redux-loop - Port of elm-effects and the Elm Architecture to Redux that allows you to sequence your effects naturally and purely by returning them from your reducers.
- redux-side-effects - Redux toolset for keeping all the side effects inside your reducers while maintaining their purity.
- redux-logic - Redux middleware for organizing business logic and action side effects.
- redux-observable - RxJS middleware for action side effects in Redux using "Epics".
- redux-ship - Composable, testable and typable side effects.
Aims to make parts of the source code easier to read/write.
- redux-act - Opinionated lib to create actions and reducers for Redux.
- redux-crud - Set of standard actions and reducers for Redux CRUD Applications.
- redux-devtools-inspector - Another Redux DevTools Monitor.
- redux-diff-logger - Diff logger between states for Redux.
- redux-devtools-chart-monitor - Chart monitor for Redux DevTools.
- redux-devtools - DevTools for Redux with hot reloading, action replay, and customizable UI.
- redux-devtools-dispatch - Dispatch your actions manually to test if your app Reacts well.
- redux-devtools-dock-monitor - Resizable and movable dock for Redux DevTools monitors.
- redux-devtools-filterable-log-monitor - Filterable tree view monitor for Redux DevTools.
- redux-devtools-log-monitor - The default monitor for Redux DevTools with a tree view.
- remote-redux-devtools - Redux DevTools remotely.
- redux-test-recorder - Redux middleware to automatically generate tests for reducers through ui interaction.
- react-redux - Official React bindings for Redux.
- react-easy-universal - Universal Routing & Rendering with React & Redux was too hard. Now it's easy.
- redux-form-material-ui - Set of wrapper components to facilitate using Material UI with Redux Form.
- redux-async-connect - It allows you to request async data, store them in Redux state and connect them to your React component.
- redux-tiny-router - Router made for Redux and made for universal apps. Stop using the router as a controller, it's just state.
- redux-router - Redux bindings for React Router – keep your router state inside your Redux store.
- react-router-redux - Ruthlessly simple bindings to keep react-router and Redux in sync.
- ground-control - Scalable reducer management & powerful data fetching for React Router & Redux.
- redux-form - Higher Order Component using react-redux to keep form state in a Redux store.
- react-redux-form - Create forms easily in React with Redux.
- redux-react-local - Local component state via Redux.
- redux-ui - Easy UI state management for React Redux.
- redux-actions - Flux Standard Action utilities for Redux.
- redux-promise - FSA-compliant promise middleware for Redux.
- backbone-redux - Easy way to keep your backbone collections and Redux store in sync.
- redux-falcor - Connect your Redux front-end to your falcor back-end.
- redux-observable - RxJS middleware for action side effects in Redux using "Epics".
- rx-redux - Reimplementation of Redux using RxJS.
- redux-rx - RxJS utilities for Redux.
- redurx - Redux'ish Functional State Management using RxJS.
- redux-electron-store - Redux store enhancer that allows automatic synchronization between electron processes.
- deku-redux - Bindings for Redux in deku < v2.
- redux-rollbar-middleware - Redux middleware that wraps exceptions in actions and sends them to Rollbar with current state.
- kasia - React Redux toolset for the WordPress API.
Boilerplates / Scaffolds / Starter Kits / Generators / Stack Ensembles
- redux-cli - Opinionated CLI for building Redux/React apps quicker.
- reactuate - React/Redux stack (not a boilerplate kit).
- react-chrome-extension-boilerplate - Boilerplate for Chrome Extension React.js project.
- universal-redux - Npm package that lets you jump right into coding React and Redux with universal (isomorphic) rendering. Only manage Express setups or Webpack configurations if you want to.
- generator-react-aspnet-boilerplate - Starting point for building isomorphic React applications with ASP.NET Core 1, leveraging existing techniques.
- generator-redux - CLI tools for Redux: next-gen functional Flux/React with devtools.
- generator-react-webpack-redux - React Webpack Generator including Redux support.
- socrates - Small (8kb), batteries-included Redux store to reduce boilerplate and promote good habits.
- redux-core - Minimal Redux.
- Many tools and middlewares
- Redux offline docs
- Flux challenge
- Sound Redux - a simple Soundcloud client
- Favesound Redux - SoundCloud Client for Artists
- Structor - a user interface builder for React
- generator-redux - CLI tools for Redux: next-gen functional Flux/React with devtools
- generator-reactapp - Yeoman generator for react app with redux
- Rekit - Toolkit for building scalable web apps with React, Redux and React-router
- Spectacle - ReactJS based Presentation Library
- Notes (and partial transcription) of Dan Abramov's Redux course videos on http://egghead.io
- Comprehensive Notes for Learning (how to use) Redux to manage state in your Web/Mobile Apps
- React Redux [RU tutorial]
- Redux without profanity
- React and Redux Single Page Applications Resources
- A categorized list of Redux-related addons, libraries, and utilities
- Building the F8 2016 App (Redux, GraphQL, React Native)
- The Elm Architecture in JavaScript
- React Redux Workflow - Graphical Cheat Sheet
- Building Applications with React and Redux in ES6 on Pluralsight
- Writing a Basic App in Redux
- Learn how to use Redux step by step
- Tutorial: Handcrafting an Isomorphic Redux Application (With Love)
- 0 to 1 : Getting started with Redux
- Redux Chinese Document
- Redux Document (Traditional Chinese)
- Relay and Routing
- Understanding Redux Middleware
- Several videos about Redux + Falcor and Example code
- Redux Middleware: Behind the Scenes
- A proposal for bundling reducers, action types and actions when using Redux
- Full-Stack Redux Tutorial - A Comprehensive Guide to Test-First Development with Redux, React, and Immutable Source Server + Client
- Redux best practices
- The 3REE Stack: React + Redux + RethinkDB + Express.js
- React Tutorial - Converting Reflux to Redux
- Redux example using 500px API (with ES6)
- Building a boilerplate for a Koa, Redux, React application including Webpack, Mocha and SASS - This article explains in detail how this koa-redux-react-boilerplate was built and the technologies it uses.
- Typed React and Redux
- A cartoon intro to Redux
- Join The Dark Side Of The Flux: Responding to Actions with Actors
- Can I dispatch multiple actions from Redux action creators?
- Understanding Redux (or, How I Fell in Love with a JavaScript State Container)
- Your First Immutable React & Redux App
- Getting Started with Redux - Egghead's video lessons from Dan Abramov
- Redux Testing Video Lessons - a few short Egghead video lessons (some free, some require a subscription)
- Implementing a smart Login Modal with Redux, reselect and ReactJS
- How to Build a Todo App Using React, Redux, and Immutable.js
- Rethinking Redux
- Managing Side Effects In React + Redux Using Sagas
- Secure Your React and Redux App with JWT Authentication
- Getting started with Redux and GraphQL
- Data Flows with Angular 2 and Redux
- Simple Routing with Redux and React
- Redux nowadays : From actions creators to sagas
- Master Complex Redux Workflows with Sagas
- Angular 2 Application Architecture - Building Flux Apps with Redux and Immutable.js
- React, Redux and Immutable.js: Ingredients for Efficient Web Applications
- An Introduction to React Redux (Part 1)
- An Introduction to React Redux (Part 2)
- Rules For Structuring (Redux) Applications
- Redux for the very beginner
- Redux - Calling web service asynchronously
- Animating with React, Redux, and d3
- Build an Image Gallery Using React, Redux and redux-saga
- Introducing redux-operations
- Solving Redux’s shortcoming in 150 LOCs
- The Anatomy Of A React Redux App
- Getting Started with React, Redux and Immutable: a Test-Driven Tutorial (Part 2)
- Leveling Up with React: Redux
- Complete intro to react
- Recreating Redux — Behind the magic curtain
- Let's Build a Redux Powered React Application
- Deep Introduction to Redux - Seriese 1/3
- Universal Rendering with Redux and React-Router - Seriese 2/3
- Unit Testing Redux Apps - Seriese 3/3
- Using Aurelia and Redux together for good times all around
- Comparing Redux and Relay
- Building React Applications with Idiomatic Redux
- The SoundCloud Client in React + Redux
- 深入浅出 Redux
- Building Angular 2 applications with Immutable.js and Redux
- Tutorial: Building Redux in TypeScript with Angular 2
- Improving React and Redux performance with Reselect
- Recipes for Redux
- Getting Started with Redux & Angular 2
- Universal/Isomorphic React+Redux on a Swift Web Backend
- Creating Reusable React-Redux Components Through Scoping
- React+Redux系列教程
- 书籍:《React 与 Redux 开发实例精解》
- How to use Redux on highly scalable javascript applications?
- Angular to React/Redux, a Guide for Angular v1 Experts Looking to Learn React/Redux
- redux-minimal - Minimalist react-redux starter kit which let's you build rich real world apps
- Modern and Scalable React/Redux Boilerplate - Flexible starter kit using Webpack 2 (tree-shaking) / React Hot Loader v3 / Code Splitting for React Router / PostCSS / CSS Modules / custom Ducks pattern app architecture / best practices / Sentry error tracking / Enzyme test environment 🚀
- react-production-starter - React boilerplate with isomorphic rendering, async react-router routes, async redux reducers, async data fetching, and code-splitting. 🤘 🔥
- mern.io - Simple full-stack boilerplate to get started with building isomorphic/universal apps, handles api part and also offers a cli to generate the boilerplate 🤘 🔥
- universal-react-redux - Opinionated Universal React/Redux/Webpack with HMR. Continually updated. 🤘 🔥
- react-slingshot - React Redux Starter Kit with hot reloading, tests and example app
- react-redux-boilerplate - React Redux Boilerplate
- react-boilerplate - React + Typescript + Sass boilerplate
- react-redux-scaffold - Combination of redux, react-router and ES6+ support
- simple-redux-boilerplate - Simple and guided React, Redux boilerplate w/ Transform HMR! 🔥
- reactv - React Redux example
- redux-boilerplate - Boilerplate for Redux
- react-redux-starter-kit - Get started with React, Redux, and React-Router.
- simplest-redux-example - Simplest Redux + React example for beginners
- redux-easy-boilerplate - React Redux easy boilerplate
- dicty-redux - Starter kit to bootstrap React and Redux (Flux) based web application
- 3ree - Boilerplate & Demo for Universal Realtime Apps built with React + Redux + RethinkDB + Express
- react_scaffolding - React + React Router 1.0 + Redux + Webpack & Hot Module Replacement
- express-redux-sample - Express-Redux-PassportJs-MySQL Boilerplate
- redux-blog-example - Redux-Webpack-Babel Blog Platform boilerplate
- redux-undo-boilerplate - a magical boilerplate with hot reloading and awesome error handling
- redux500 - The Redux version of isomorphic500
- redux-demo - Redux port of SurviveJS - Webpack and React Kanban app
- react-redux-universal-hot-example - A starter boilerplate for a universal webapp using express, react, redux, webpack, and react-hot-loader 🤘
- rde - Reactive Live Programming Environment
- React Redux Starter Kit - Yet another React and Redux based web application starter kit
- skeleton - A simple project-stub to show the basic ideas. Also serves you as a quick start for your project (Mori + Redux)
- browser-redux - Building Chrome apps and cross-browser extensions with Redux and Webpack
- react-for-hipsters-boilerplate - Fresh boilerplate with brand new hot reloading confing and other hipster stuff
- Documented Koa Redux React Webpack boilerplate- The building process of this boilerplate is deeply documented from 0 for learning purposes. You can find the docs here.
- err - Electron, React, Redux-devtools boilerplate for building cross-platform apps.
- friends-app-redux - React Redux Universal Hot Example
- isomorphic-redux-app - Redux Isomorphic App (with async content)
- starter-kit - Project boilerplate using React, Redux and Uniloc http://unicornstandard.com/packages/boilerplate.html
- loopback-redux-react-boilerplate - A boilerplate for a Redux-React application using LoopBack
- breko-hub - Babel React Koa Hot Universal Boilerplate -- A simple, clean and consistent boilerplate for creating universal webapps with universal data fetching and SocketIO integration
- React Redux Cordova Boilerplate
- react-boilerplate - Performance orientated, offline-first boilerplate feat. hot-reloading, PostCSS and the best developer experience.
- react-webpack-node - Boilerplate for an universal React + Redux/alt Flux application using Webpack running on a node express server
- Hapi React Starter Kit - Universal, Redux, Redis, Socket.io, Intl
- Universal Redux Template - A clean, extensible react + redux boilerplate with universal rendering, testing and more
- universal-js - A universal Javascript starter kit inc. React, Redux, Redux Dev Tools, Universal Redux Router, CSS Modules, hot module reloading, Babel for ES2015+ and ESLint
- redux-react-material-boilerplate - Simple boilerplate inc. React, Redux, Hot reload and Material-ui
- react-redux-starter - React Redux Starter
- Reduxible - The Fast and Easy way to make a React + Redux apps
- react-workflow - A large SPA boilerplate for web development built on top of Facebook's React library,use redux architecture
- ReacToGo - A simple ES6 boilerplate with Redux architecture and ImmutableJS: Hot Reload, React UI Comp, Firebase, Router
- React/Redux simple CRUD with persistent state and local async actions (add a manifest file and you get an offline webapp)
- StarHackIt - An React/Redux Node full-stack starter kit with authentication and authorization code
- React Seed - A barebones scalable directory structure and package.json for facilitating new React + Redux projects. No fat to trim here!
- React/Redux with Auth boilerplate - Very simple boilerplate, good for fast creating admin panels / dashboard. Included: React, Redux, ReduxForm, React-Router, Simple Authenticate, Hot Reload and Webpack (with babel) 🔥
- Docker + React/Redux + Node + PostgreSQL - full stack boilerplate with fully dockerized workflows for development, deployment, testing
- Redux universal boilerplate - boilerplate for react universal application building on flux architecture based on redux implementation.
- React Redux Universal Boilerplate - An Universal ReactJS/Redux Boilerplate.
- react-hot-redux-firebase-starter - Starter boilerplate for using React/Redux with Firebase 3.0 API, include the new React Hot Loader 3.0 🔥
- React Redux Firebase Boilerplate - Designed for quickly spin up your apps with Firebase, using bunch of awesome new front-end technologies includes webpack build system, hot reloading, routing & sass support. 🔥
- React Universal Saga - Universal React Starter Kit ft. Redux Saga
- React Redux SoundCloud Client - Seed Project for a SoundCloud Client with working Login + Extension Seed Projects
- vortigern - A universal boilerplate for building web applications w/ TypeScript, React, Redux and more.
- angular2-redux-contact-list - Simple contact list built with Angular 2, Immutable.js and Redux
- react-redux-seed - 使用 React 与 Redux 实现 Universal 渲染的种子工程
- ARc - A progressive React starter kit based on Atomic Design with redux, redux-saga and redux-form
- edux - fast Redux without constants and switches. Actions and reducers are generated from single source.
- fast-redux - Redux extension with O(1) speed and dynamic importing of reducers/actions.
- Examples
- CarteJaune - An open source Redux/ExponentJS (React Native) app leveraging redux-saga to keep track of your vaccinations
- noder-react-native - The mobile app of cnodejs.org written in React Native
- react-native-redux-counter
- react-native-counter-ios-android
- react-native-redux-groceries - An example app using React Native, Redux, Firebase, and AsyncStorage for offline data
- react-native-sound-cloud
- snowflake - mobile app starter: Login, Logout, Reset Password, Update Profile, Hot Reload
- uestc-bbs-react-native - An iOS client for http://bbs.uestc.edu.cn/ written in React Native with Redux
- movies-redux - redux implementation of react-native movies example that is included in react-native source
- react-native-redux-todo-list - A sample todo list app developed by using react-native and redux
-
Containers
-
Middlewares
- redux-cheerio - Make HTTP requests and then parse the responses with jQuery selectors using Cheerio
- redux-reporter - Report actions & metadata to 3rd party providers, extremely useful for analytics and error handling (New Relic, Sentry, Adobe DTM, Keen, etc.)
- redux-transduce - Transducer utilities for Redux
- redux-actions - Flux Standard Action utilities for Redux
- redux-promise - FSA-compliant promise middleware for Redux
- redux-sync-promise - Middleware for writing asynchronous actions in synchronous style
- redux-simple-promise - FSA-compliant promise middleware for Redux with simple behaviour with minimal boilerplate declarations
- redux-async - FSA-compliant promise property middleware for Redux
- redux-async-queue - Manage queues of thunk actions
- redux-async-initial-state - Set initial Redux state asynchronously
- redux-await - Manage async redux actions sanely
- redux-rx - RxJS utilities for Redux
- reselect - Selector library for Redux like in NuclearJS
- react-redux - React bindings for Redux
- redux-react-router - Redux bindings for React Router – keep your router state inside your Redux store
- redux-promise-middleware - Redux middleware for resolving and rejecting promises
- redux-thunk - Thunk middleware for Redux
- redux-batched-updates - Batch React updates that occur as a result of Redux dispatches, to prevent cascading renders.
- redux-combine-actions - Redux middleware that allows you to easy combine actions and dispatch them sequentially
- redux-catch-promise - Extended replacement of redux-thunk middleware to supporting async-await functions and implement server-side rendering for React components with async state
- redux-delegator - Compose redux reducers in a structured way
- routex - Simple router for Redux universal applications. Can be used with React too
- redux-persist-store - Persist and rehydrate a redux store
- adrenaline - React bindings for Redux with Relay in mind
- redux-localstorage - Store enhancer that syncs (a subset) of your Redux store state to localstorage.
- redux-storage - Persistence layer for redux with flexible backends
- redux-pouchdb - sync store state to pouchdb
- redux-vstack-router - Helpers to bind vstack-router to redux
- redux-create-store
- redux-batched-subscribe - Batch calls to subscribe handlers with a custom function, including debouncing or React batched updates.
- redux-logger - Logger middleware for Redux
- redux-node-logger - A Redux Logger for Node Environments
- redux-diff-logger - Diff logger between states for Redux
- redux-debug - debug(...) middleware for Redux
- redux-requests - Avoid issuing duplicate HTTP requests
- redux-owl - Redux One Way Linking
- redux-act - An opinionated lib to create actions and reducers for Redux
- redux-act-async - Reducing boilerplate when creating asynchronous actions in Redux
- redux-raven-middleware - Redux middleware for sending error reports to Sentry through raven-js
- react-redux-persist-sentry-middleware - Redux middleware for sending error reports along with persisted data as payload to Sentry through raven-js
- redux-routing - Universal routing built on top of redux
- redux-undo - Simple undo/redo functionality for redux state containers
- rn-redux-mixpanel - Configurable Redux middleware that sends your actions & user profile data to Mixpanel
- redux-falcor - Connect your redux front-end to your falcor back-end
- redux-analytics - Trigger analytics events based on your event metadata
- redux-ignore - Ignore redux actions by array or filter function
- redux-recycle - Reset the redux state on certain actions
- re-notif A notification center based on React & Redux.
- redux-lunr - Make your redux store searchable with Lunr.js
- redux-ensure-fsa - Development middleware to check for FSA-compliant actions
- redux-pagan - internationalization via redux
- redux-debounce - Debounce your actions!
- redux-future - FSA-compliant future monad middleware for redux
- redux-io - FSA-compliant io monad middleware for redux
- redux-either - FSA-compliant either monad middleware for redux
- redux-timeout - Trigger actions based on timeouts
- redux-observable-middleware - Redux middleware for subscribing to observables
- redux-observable - RxJS 5-based middleware for Redux. Compose and cancel actions as epics.
- redux-deferred - Redux middleware for jQuery Deferred Object
- redux-task - A simple Side Effects manager for redux
- redux-gen - Generator based middleware for redux
- redux-authentication - Authentication component for Redux
- socket.io-redux - Redux middleware to emit action via socket.io
- redux-catch - Error catcher middleware for Redux reducers and middlewares
- redux-elm-middleware - Elm middleware for redux
- redux-api-middleware - Redux API middleware based on the real-world example
- redux-mediaquery - Redux ActionCreator to put responsive-design breakpoints in your store
- redux-amrc - Redux async middleware and reducer creator
- redux-fetch-middleware - Redux middleware that help user to treat simple request via fetch api
- redux-url - A Redux middleware for synchronizing the URL with the state
- redux-most - Most.js based middleware for Redux. Handle async actions with monadic streams & reactive programming.
- redux-cookies-middleware - a Redux middleware which syncs a subset of your Redux store state with cookies.
- redux-cycles - Handle async actions with functional and reactive programming.
-
Tools
- actionware - Redux with less boilerplate + error/busy status for every action
- reactotron - Control, monitor, and instrument your React Native apps from the comfort of your TTY
- redux-test-recorder - Redux test recorder is a redux middleware + included component for automagically generating tests for your reducers based on the actions in your app
- redux-devtools - DevTools for Redux with hot reloading, action replay, and customizable UI
- react-router-redux - Ruthlessly simple bindings to keep react-router and redux in sync
- redux-tiny-router - A Router made for Redux, stop using the router as a controller it's just state!
- redux-devtools-gentest-plugin - Generate mocha like tests from redux-devtools session
- generator-redux - CLI tools for Redux: next-gen functional Flux/React with devtools
- generator-reactapp - Yeoman generator for react app with redux
- generator-redux-app - Scaffold out a redux app with counter example and react-router
- redux-loader - A high order component for Redux. This components loads resources and passes them to the child components via props
- asyncdataloader-react -AsyncDataLoader is a React Higher Order Component which takes responsibility of fetching data of the Wrapped Component and offers many options like showing an interface preview of the Wrapped Component while data is being fetched, refetch data after specified time.
- redux-rest - Automatically create Flux action constants, action creators and Redux reducers for your REST API
- react-reach - A library to communicate with Graphql through Redux
- redux-api - Flux REST API for redux infrastructure
- redux-store-validator - Add validation to your Redux reducers
- firedux - Firebase + Redux for ReactJS
- vstack-router - Universal router
- redux-ecommerce - E-commerce flux with redux
- redux-form - An ES7 decorator for forms using Redux and React
- redux-form-validation - Form validation for controlled & uncontrolled inputs
- simple-redux-form - A tiny redux-form alternative Higher Order Component for forms.
- redux-slider-monitor - A custom monitor for Redux DevTools to replay recorded Redux actions
- updeep - Easily update nested frozen objects and arrays in a declarative and immutable manner
- redux-immutable - Streamlines use of Immutable.js with Redux reducers.
- redux-import-export-monitor - A monitor for copying your serialized action log to the clipboard, as well as pasting it in from somewhere else
- icedam - Just-in-time immutability: freezes data sent to views.
- react-inline-grid - Predictable flexbox based grid for React using Redux and Immutable-js.
- redux-easy-actions - Sugar library for creating Redux or Flux actions
- redux-mount - Mount state data and change its state values on the fly
- redux-multi - Dispatch multiple actions from one action creator
- immu - A tiny, fail-fast, lazy, immutable Javascript objects library
- Generate standard action creators and reducers for CRUD applications
- Redux & ImmutableJs - Integration of Redux & ImmutableJs that 100% conforms Redux standards
- redux-tcomb - Immutable and type-checked state and actions for Redux
- redux-react-router-transitions - Attach react-router transitions to arbitrary actions
- redux-optimist - Optimistically apply actions that can be later commited or reverted.
- redux-devtools-diff-monitor - Redux DevTools – Diff Monitor
- redux-store-visualizer - Visualize Redux store in real time
- generator-redux - CLI tools for Redux: next-gen functional Flux/React with devtools
- generator-reactapp - Yeoman generator for react app with redux
- redux-viewmodel - ViewModel wrapping for Redux & React
- redux-utils - Utility functions for Redux
- multireducer - A utility to wrap many copies of a single Redux reducer into a single key-based reducer
- subdivide - User defined UI layout: Every pane can be subdivided and any widget assigned to any pane
- replux - Self contained components and enhancements for Redux
- redux-immutable-utils - Utilities for using Immutable with Redux
- recompose - A microcomponentization toolkit for React
- redux-lift - Lifting for Redux
- redux-router5 - router5 integration with Redux
- redux-devtools-extension - Redux DevTools Extension
- universal-redux-router - A very simple router for Redux and React that works on both server and client
- redux-watch - Watch/monitor for state changes on an object path
- redux-devtools-filterable-log-monitor - Filterable tree view monitor for Redux DevTools
- redux-flash-notification - A flash notification component for Redux
- redux-saga - An alternative side effect model for Redux apps
- remote-redux-devtools - Use Redux DevTools remotely for React Native, hybrid, desktop and server side Redux apps
- redux-devtools-dispatch - Dispatch your actions manually to test if your app reacts well
- redux-loop - Sequence your effects naturally and purely by returning them from your reducers
- redux-orm - A small, simple and immutable ORM to manage data in your Redux store
- redux-bacon - Utilities for attaching Bacon.js to Redux
- rereduce - Reducer library for Redux
- redux-decorators - A ridiculously good syntax for working with Redux and TypeScript. Currently limited to Angular 2 but could potentially be used elsewhere
- redux-test-reducer - Simple and clean testing mechanism for Redux reducers
- redux-devtools-inspector - Another Redux DevTools Monitor
- redux-ava - Helpers for writing Redux tests in AVA
- redux-cli - An opinionated CLI for building redux/react apps quicker
- redux-saga-rxjs - RxJS implementation of Saga pattern for redux
- redux-actions-assertions - Assertions for redux actions testing
- redux-duck - Helper function to create Redux modules using the ducks-modular-redux proposal
- redux-dispatch-cli - A CLI tool for Redux remote dispatch. Used in remote-redux-devtools
- redux-immutable-reducer - Immutable reducer states with Redux
- redux-bootstrap - configure React + React-Router + Redux + Immutable.js with one function!
- redux-director - Redux bindings to director router
- redux-q - Provides a way to queue callbacks until an action is dispatched
- redux-apist - Creator API actions for redux-thunk
- reswitch — Write reducers with less boilerplate
- redux-autoform - Create Redux-Forms dynamically out of metadata
- redux-ship - Composable, testable and typable side effects
- entman - A simple library to manage normalizr entities in a Redux store
- yax - Yet another store using redux and inspired by vuex
- listate - Library to listen/observe/watch changes of Redux store state
- redux-reducer-async - Create redux reducers for async behaviors of multiple actions.
- redux-autoreducers - Redux Auto reducers generator.
-
Frameworks
- Jumpsuit - A powerful & efficient React framework. Jump in. Zip up. Build great apps.
- Jumpstate - Simple and powerful state management for Redux
- dva - Front-end framework based on react, redux, react-redux, react-router and redux-saga.
- Vdux - World's smallest framework. Stateless Virtual DOM <-> Redux
- Esex - Full-stack Universal JavaScript Framework (Redux+RxJs)
- Ripster
- Este - The most complete minimal dev stack / boilerplate for React & Redux universal web apps
- stardux - Functional DOM containers based on starplate, IncrementalDOM, and redux
- nux - A Push-Based Functional Reactive Web Application Framework
- Keo - Plain functions for a more functional Deku approach to creating React components, with functional goodies such as compose, memoize, etc... for free
- plait - A minimal JavaScript framework for building reactive web components
- reactuate — A React/Redux stack (not a boilerplate!) with a focus on Domain-Driven Design
- meatier - Like meteor, but meatier
- relax - New generation CMS on top of React, Redux and GraphQL
- lovli.js - A boilerplate for developing react+redux applications with rethinkdb/horizon as realtime database and express for the server
- kea - Well-readable, self-documenting and easily refactorable framework that brings your data to life! Comes with scaffolding tools 🐦
- Feeble - A framework built on top of React/Redux/redux-saga which aims to make building React/Redux applications easier and better.
- Conventional-Redux - A wrapper for react-redux which provides API based on convention over configuration pattern.
- redux-react-i18n - An i18n solution for redux/react✌🏿✊🏽🤘🏻
- redux-action-host - Redux middleware to add the hostname of the originating computer to action metadata
- Mirror - A simple and powerful React framework with minimal API and zero boilerplate
- flux-ts - A small flux implementation heavily inspired by redux
- chopped-redux - A very small Flux implementation based on Redux
- fluxette - Minimalist, functional, and concise Flux
- rx-redux - A reimplementation of redux using RxJS
- understate - A simple state manager
- refer - Redux-like library for handling global state on functional style
- bobflux - Bobflux is pure functional implementation of FLUX pattern and is fitted to Bobril
- mobx - Simple, scalable state management
- Examples
Incremental DOM - Incremental DOM is a library for building up DOM trees and updating them in-place when data changes
- Examples
- Examples
- Examples
- angular2-redux-example - Example project for using pure Redux with Angular 2 and TypeScript
- @angular-redux/store - Angular 2 bindings for Redux
- angular2-redux - Wrapper components for using Redux in an Angular2 application
- ng2redux - Angular 2 bindings for Redux implemented with TypeScript and decorators
- Examples
- Examples
- Examples
Aurelia - is a next gen JavaScript client framework for mobile, desktop and web that leverages simple conventions to empower your creativity
- Examples
- Examples
-
.NET
-
Java
-
Swift
-
Purescript
-
Redux's concepts
Redux official documentation does a great job at explaining Redux's core principles.
-
Why immutable data structures
The guide on performance of React's official documentation explains well what immutable data structures are and why they play an important role.
-
Side Effects
Redux Loop's readme gives a good insight on Side Effects in the context of Redux.
Reading the aforementioned material will get you a good start for writing apps with Redux. If you are curious for more, check out following resources.
-
Functional Programming - Basics
This post goes over basic concepts of functional programming while building a YouTube instant search demo app.
-
Reactive Programming
This introduction to Reactive Programming explains Reactive Programming with clarity.
-
Functional Programming - Going beyond
Well written article that talks about interesting computer science concepts implemented in functional languages and how these apply to JavaScript.
-
Monads
Curious about monads? Wikipedia gives a good overview on monads and this article explains monads in more details with graphics and simple examples.
Introduction > Getting Started: First steps with React Redux
React Redux is the official React UI bindings layer for Redux. It lets your React components read data from a Redux store, and dispatch actions to the store to update state.
Installation#
React Redux 7.1+ requires React 16.8.3 or later, in order to make use of React Hooks.
Using Create React App#
The recommended way to start new apps with React and Redux is by using the official Redux+JS template or Redux+TS template for Create React App, which takes advantage of Redux Toolkit and React Redux's integration with React components.
An Existing React App#
To use React Redux with your React app, install it as a dependency:
You'll also need to install Redux and set up a Redux store in your app.
If you are using TypeScript, the React Redux types are maintained separately in DefinitelyTyped, but included as a dependency of the react-redux
package, so they should be installed automatically. If you still need to install them manually, run:
API Overview#
Provider
#
React Redux includes a <Provider />
component, which makes the Redux store available to the rest of your app:
Hooks#
React Redux provides a pair of custom React hooks that allow your React components to interact with the Redux store.
useSelector
reads a value from the store state and subscribes to updates, while useDispatch
returns the store's dispatch
method to let you dispatch actions.
Learning React Redux#
Learn Modern Redux Livestream#
Redux maintainer Mark Erikson appeared on the "Learn with Jason" show to explain how we recommend using Redux today. The show includes a live-coded example app that shows how to use Redux Toolkit and React-Redux hooks with Typescript, as well as the new RTK Query data fetching APIs.
See the "Learn Modern Redux" show notes page for a transcript and links to the example app source.
Help and Discussion#
The #redux channel of the Reactiflux Discord community is our official resource for all questions related to learning and using Redux. Reactiflux is a great place to hang out, ask questions, and learn - come join us!
You can also ask questions on Stack Overflow using the #redux tag.
Docs Translations#
Welcome to the Redux Essentials tutorial! This tutorial will introduce you to Redux and teach you how to use it the right way, using our latest recommended tools and best practices. By the time you finish, you should be able to start building your own Redux applications using the tools and patterns you've learned here.
In Part 1 of this tutorial, we'll cover the key concepts and terms you need to know to use Redux, and in Part 2: Redux App Structure we'll examine a basic React + Redux app to see how the pieces fit together.
Starting in Part 3: Basic Redux Data Flow, we'll use that knowledge to build a small social media feed app with some real-world features, see how those pieces actually work in practice, and talk about some important patterns and guidelines for using Redux.
This page will focus on showing you how to use Redux the right way, and explain just enough of the concepts so that you can understand how to build Redux apps correctly.
We've tried to keep these explanations beginner-friendly, but we do need to make some assumptions about what you know already:
If you're not already comfortable with those topics, we encourage you to take some time to become comfortable with them first, and then come back to learn about Redux. We'll be here when you're ready!
You should make sure that you have the React and Redux DevTools extensions installed in your browser:
- React DevTools Extension:
- Redux DevTools Extension:
It helps to understand what this "Redux" thing is in the first place. What does it do? What problems does it help me solve? Why would I want to use it?
Redux is a pattern and library for managing and updating application state, using events called "actions". It serves as a centralized store for state that needs to be used across your entire application, with rules ensuring that the state can only be updated in a predictable fashion.
Why Should I Use Redux?#
Redux helps you manage "global" state - state that is needed across many parts of your application.
The patterns and tools provided by Redux make it easier to understand when, where, why, and how the state in your application is being updated, and how your application logic will behave when those changes occur. Redux guides you towards writing code that is predictable and testable, which helps give you confidence that your application will work as expected.
When Should I Use Redux?#
Redux helps you deal with shared state management, but like any tool, it has tradeoffs. There are more concepts to learn, and more code to write. It also adds some indirection to your code, and asks you to follow certain restrictions. It's a trade-off between short term and long term productivity.
Redux is more useful when:
- You have large amounts of application state that are needed in many places in the app
- The app state is updated frequently over time
- The logic to update that state may be complex
- The app has a medium or large-sized codebase, and might be worked on by many people
Not all apps need Redux. Take some time to think about the kind of app you're building, and decide what tools would be best to help solve the problems you're working on.
Redux Libraries and Tools#
Redux is a small standalone JS library. However, it is commonly used with several other packages:
React-Redux#
Redux can integrate with any UI framework, and is most frequently used with React. React-Redux is our official package that lets your React components interact with a Redux store by reading pieces of state and dispatching actions to update the store.
Redux Toolkit#
Redux Toolkit is our recommended approach for writing Redux logic. It contains packages and functions that we think are essential for building a Redux app. Redux Toolkit builds in our suggested best practices, simplifies most Redux tasks, prevents common mistakes, and makes it easier to write Redux applications.
Redux DevTools Extension#
The Redux DevTools Extension shows a history of the changes to the state in your Redux store over time. This allows you to debug your applications effectively, including using powerful techniques like "time-travel debugging".
Redux Terms and Concepts#
Before we dive into some actual code, let's talk about some of the terms and concepts you'll need to know to use Redux.
State Management#
Let's start by looking at a small React counter component. It tracks a number in component state, and increments the number when a button is clicked:
It is a self-contained app with the following parts:
- The state, the source of truth that drives our app;
- The view, a declarative description of the UI based on the current state
- The actions, the events that occur in the app based on user input, and trigger updates in the state
This is a small example of "one-way data flow":
- State describes the condition of the app at a specific point in time
- The UI is rendered based on that state
- When something happens (such as a user clicking a button), the state is updated based on what occurred
- The UI re-renders based on the new state
However, the simplicity can break down when we have multiple components that need to share and use the same state, especially if those components are located in different parts of the application. Sometimes this can be solved by "lifting state up" to parent components, but that doesn't always help.
One way to solve this is to extract the shared state from the components, and put it into a centralized location outside the component tree. With this, our component tree becomes a big "view", and any component can access the state or trigger actions, no matter where they are in the tree!
By defining and separating the concepts involved in state management and enforcing rules that maintain independence between views and states, we give our code more structure and maintainability.
This is the basic idea behind Redux: a single centralized place to contain the global state in your application, and specific patterns to follow when updating that state to make the code predictable.
Immutability#
"Mutable" means "changeable". If something is "immutable", it can never be changed.
JavaScript objects and arrays are all mutable by default. If I create an object, I can change the contents of its fields. If I create an array, I can change the contents as well:
This is called mutating the object or array. It's the same object or array reference in memory, but now the contents inside the object have changed.
In order to update values immutably, your code must make copies of existing objects/arrays, and then modify the copies.
We can do this by hand using JavaScript's array / object spread operators, as well as array methods that return new copies of the array instead of mutating the original array:
Redux expects that all state updates are done immutably. We'll look at where and how this is important a bit later, as well as some easier ways to write immutable update logic.
Terminology#
There are some important Redux terms that you'll need to be familiar with before we continue:
Actions#
An action is a plain JavaScript object that has a type
field. You can think of an action as an event that describes something that happened in the application.
The type
field should be a string that gives this action a descriptive name, like "todos/todoAdded"
. We usually write that type string like "domain/eventName"
, where the first part is the feature or category that this action belongs to, and the second part is the specific thing that happened.
An action object can have other fields with additional information about what happened. By convention, we put that information in a field called payload
.
A typical action object might look like this:
Action Creators#
An action creator is a function that creates and returns an action object. We typically use these so we don't have to write the action object by hand every time:
Reducers#
A reducer is a function that receives the current state
and an action
object, decides how to update the state if necessary, and returns the new state: (state, action) => newState
. You can think of a reducer as an event listener which handles events based on the received action (event) type.
"Reducer" functions get their name because they're similar to the kind of callback function you pass to the Array.reduce()
method.
Reducers must always follow some specific rules:
- They should only calculate the new state value based on the
state
andaction
arguments - They are not allowed to modify the existing
state
. Instead, they must make immutable updates, by copying the existingstate
and making changes to the copied values. - They must not do any asynchronous logic, calculate random values, or cause other "side effects"
We'll talk more about the rules of reducers later, including why they're important and how to follow them correctly.
The logic inside reducer functions typically follows the same series of steps:
- Check to see if the reducer cares about this action
- If so, make a copy of the state, update the copy with new values, and return it
- Otherwise, return the existing state unchanged
Here's a small example of a reducer, showing the steps that each reducer should follow:
Reducers can use any kind of logic inside to decide what the new state should be: if/else
, switch
, loops, and so on.
The Array.reduce()
method lets you take an array of values, process each item in the array one at a time, and return a single final result. You can think of it as "reducing the array down to one value".
Array.reduce()
takes a callback function as an argument, which will be called one time for each item in the array. It takes two arguments:
previousResult
, the value that your callback returned last timecurrentItem
, the current item in the array
The first time that the callback runs, there isn't a previousResult
available, so we need to also pass in an initial value that will be used as the first previousResult
.
If we wanted to add together an array of numbers to find out what the total is, we could write a reduce callback that looks like this:
Notice that this addNumbers
"reduce callback" function doesn't need to keep track of anything itself. It takes the previousResult
and currentItem
arguments, does something with them, and returns a new result value.
A Redux reducer function is exactly the same idea as this "reduce callback" function! It takes a "previous result" (the state
), and the "current item" (the action
object), decides a new state value based on those arguments, and returns that new state.
If we were to create an array of Redux actions, call reduce()
, and pass in a reducer function, we'd get a final result the same way:
We can say that Redux reducers reduce a set of actions (over time) into a single state. The difference is that with Array.reduce()
it happens all at once, and with Redux, it happens over the lifetime of your running app.
Store#
The current Redux application state lives in an object called the store .
The store is created by passing in a reducer, and has a method called getState
that returns the current state value:
Dispatch#
The Redux store has a method called dispatch
. The only way to update the state is to call store.dispatch()
and pass in an action object. The store will run its reducer function and save the new state value inside, and we can call getState()
to retrieve the updated value:
You can think of dispatching actions as "triggering an event" in the application. Something happened, and we want the store to know about it. Reducers act like event listeners, and when they hear an action they are interested in, they update the state in response.
We typically call action creators to dispatch the right action:
Selectors#
Selectors are functions that know how to extract specific pieces of information from a store state value. As an application grows bigger, this can help avoid repeating logic as different parts of the app need to read the same data:
Redux Application Data Flow#
Earlier, we talked about "one-way data flow", which describes this sequence of steps to update the app:
- State describes the condition of the app at a specific point in time
- The UI is rendered based on that state
- When something happens (such as a user clicking a button), the state is updated based on what occurred
- The UI re-renders based on the new state
For Redux specifically, we can break these steps into more detail:
- Initial setup:
- A Redux store is created using a root reducer function
- The store calls the root reducer once, and saves the return value as its initial
state
- When the UI is first rendered, UI components access the current state of the Redux store, and use that data to decide what to render. They also subscribe to any future store updates so they can know if the state has changed.
- Updates:
- Something happens in the app, such as a user clicking a button
- The app code dispatches an action to the Redux store, like
dispatch({type: 'counter/increment'})
- The store runs the reducer function again with the previous
state
and the currentaction
, and saves the return value as the newstate
- The store notifies all parts of the UI that are subscribed that the store has been updated
- Each UI component that needs data from the store checks to see if the parts of the state they need have changed.
- Each component that sees its data has changed forces a re-render with the new data, so it can update what's shown on the screen
Here's what that data flow looks like visually:
What You've Learned#
Redux does have a number of new terms and concepts to remember. As a reminder, here's what we just covered:
- Redux is a library for managing global application state
- Redux is typically used with the React-Redux library for integrating Redux and React together
- Redux Toolkit is the recommended way to write Redux logic
- Redux uses a "one-way data flow" app structure
- State describes the condition of the app at a point in time, and UI renders based on that state
- When something happens in the app:
- The UI dispatches an action
- The store runs the reducers, and the state is updated based on what occurred
- The store notifies the UI that the state has changed
- The UI re-renders based on the new state
- Redux uses several types of code
- Actions are plain objects with a
type
field, and describe "what happened" in the app - Reducers are functions that calculate a new state value based on previous state + an action
- A Redux store runs the root reducer whenever an action is dispatched
- Actions are plain objects with a
What's Next?#
We've seen each of the individual pieces of a Redux app. Next, continue on to Part 2: Redux App Structure, where we'll look at a full working example to see how the pieces fit together.
Lately one of the biggest debates in the frontend world has been about Redux. Not long after its release, Redux became one of the hottest topics of discussion. Many favored it while others pointed out issues.
Redux allows you to manage your app’s state in a single place and keep changes in your app more predictable and traceable. It makes it easier to reason about changes occurring in your app. But all of these benefits come with tradeoffs and constraints. One might feel it adds up boilerplate code, making simple things a little overwhelming; but that depends upon the architecture decisions.
One simple answer to this question is you will realize for yourself when you need Redux. If you’re still confused as to whether you need it, you don’t. This usually happens when your app grows to the scale where managing app state becomes a hassle; and you start looking out for making it easy and simple.
State management is essentially a way to facilitate communication and sharing of data across components. It creates a tangible data structure to represent the state of your app that you can read from and write to. That way, you can see otherwise invisible states while you’re working with them.
Most libraries, such as React, Angular, etc. are built with a way for components to internally manage their state without any need for an external library or tool. It does well for applications with few components, but as the application grows bigger, managing states shared across components becomes a chore.
In an app where data is shared among components, it might be confusing to actually know where a state should live. Ideally, the data in a component should live in just one component, so sharing data among sibling components becomes difficult.
For instance, in React, to share data among siblings, a state has to live in the parent component. A method for updating this state is provided by the parent component and passed as props to these sibling components.
Here’s a simple example of a login component in React. The input of the login component affects what is displayed by its sibling component, the status component:
class App extends React.Component { constructor(props) { super(props); this.state = { userStatus: "NOT LOGGED IN"} this.setStatus = this.setStatus.bind(this); } setStatus(username, password) { const newUsers = users; newUsers.map(user => { if (user.username == username && user.password === password) { this.setState({ userStatus: "LOGGED IN" }) } }); } render() { return (
Remember, this data is not needed by the parent component, but because its children need to share data, it has to provide a state.
Now imagine what happens when a state has to be shared between components that are far apart in the component tree. The state has to be passed from one component to another until it gets to where it is needed.
Basically, the state will have to be lifted up to the nearest parent component and to the next until it gets to an ancestor that is common to both components that need the state, and then it is passed down. This makes the state difficult to maintain and less predictable. It also means passing data to components that do not need it.
It’s clear that state management gets messy as the app gets complex. This is why you need a state management tool like Redux that makes it easier to maintain these states. Let’s get a good overview of Redux concepts before considering its benefits.
The way Redux works is simple. There is a central store that holds the entire state of the application. Each component can access the stored state without having to send down props from one component to another.
There are three building parts: actions, store, and reducers. Let’s briefly discuss what each of them does. This is important because they help you understand the benefits of Redux and how it’s to be used. We’ll be implementing a similar example to the login component above but this time in Redux.
Simply put, actions are events. They are the only way you can send data from your application to your Redux store. The data can be from user interactions, API calls, or even form submissions.
Actions are sent using the store.dispatch()
method. Actions are plain JavaScript objects, and they must have a type property to indicate the type of action to be carried out. They must also have a payload that contains the information that should be worked on by the action. Actions are created via an action creator.
Here’s an example of an action that can be carried out during login in an app:
{ type: "LOGIN", payload: { username: "foo", password: "bar" } }
Here is an example of its action creator:
const setLoginStatus = (name, password) => { return { type: "LOGIN", payload: { username: "foo", password: "bar" } } }
As explained earlier, the action must contain the type property and then the other payload to be stored.
Reducers are pure functions that take the current state of an application, perform an action, and return a new state. These states are stored as objects, and they specify how the state of an application changes in response to an action sent to the store.
It is based on the reduce
function in JavaScript, where a single value is calculated from multiple values after a callback function has been carried out.
Here is an example of how reducers work in Redux:
const LoginComponent = (state = initialState, action) => { switch (action.type) { case "LOGIN": return state.map(user => { if (user.username !== action.username) { return user; } if (user.password == action.password) { return { ...user, login_status: "LOGGED IN" } } }); default: return state; } };
Reducers take the previous state of the app and return a new state based on the action passed to it.
As pure functions, they do not change the data in the object passed to them or perform any side effect in the application. Given the same object, they should always produce the same result.
The store holds the application state. It is highly recommended to keep only one store in any Redux application. You can access the state stored, update the state, and register or unregister listeners via helper methods.
Let’s create a store for our login app:
const store = createStore(LoginComponent);
Actions performed on the state always return a new state. Thus, the state is very easy and predictable.
Now that we know a little more about Redux, let’s go back to our login component example that was implemented earlier and see how Redux can improve the component.
class App extends React.Component { render() { return (
With Redux, there’s one general state in the store, and each component has access to the state. This eliminates the need to continuously pass state from one component to another. You can also select the slice from the store for a particular component; this makes your app more optimized.
Redux allows developers to intercept all actions dispatched from components before they are passed to the reducer function. This interception is done via middlewares.
Building on the example Login component discussed in the last section, we might want to sanitize the user’s input before it reaches our store for further processing. This can be achieved via Redux middleware.
Technically, middlewares are functions that call the next method received in an argument after processing the current action. These are called after every dispatch.
Here’s what a simple middleware looks like:
function simpleMiddleware({ getState, dispatch }) { return function(next){ return function(action){ const nextAction = next(action); const state = getState(); return nextAction; } } }
This might look a little overwhelming, but in most cases, you might not need to create your own middleware since the huge Redux community has already made a number of them available. If you feel middleware is required, you will enjoy it because it gives you a lot of power to do tons of great work with the best abstraction.
When using Redux with React, states will no longer need to be lifted up. This makes it easier for you to trace which action causes any change.
As you can see in the example above, the component does not need to provide any state or method for its children components to share data among themselves. Everything is handled by Redux. This greatly simplifies the app and makes it easier to maintain.
This is the primary reason why you should use Redux, but it’s not the only benefit. Take a look at the list below for a summary of what you stand to gain by using Redux for state management.
In Redux, the state is always predictable. If the same state and action are passed to a reducer, the same result is always produced because reducers are pure functions. The state is also immutable and is never changed. This makes it possible to implement arduous tasks like infinite undo and redo. It is also possible to implement time travel — that is, the ability to move back and forth among the previous states and view the results in real time.
Redux is strict about how code should be organized, which makes it easier for someone with knowledge of Redux to understand the structure of any Redux application. This generally makes it easier to maintain. This also helps you segregate your business logic from your component tree. For large scale apps, it’s critical to keep your app more predictable and maintainable.
Redux makes it easy to debug an application. By logging actions and state, it is easy to understand coding errors, network errors, and other forms of bugs that might come up during production.
Besides logging, it has great DevTools that allow you to time-travel actions, persist actions on page refresh, etc. For medium- and large-scale apps, debugging takes more time then actually developing features. Redux DevTools makes it easy to taker advantage of all Redux has to offer.
You might assume that keeping the app’s state global would result in some performance degradation. To a large extent, that’s not the case.
React Redux implements many performance optimizations internally so that your own connected component only rerenders when it actually needs to.
It is easy to test Redux apps since functions used to change the state of pure functions.
You can persist some of the app’s state to local storage and restore it after a refresh. This can be really nifty.
Redux can also be used for server-side rendering. With it, you can handle the initial render of the app by sending the state of an app to the server along with its response to the server request. The required components are then rendered in HTML and sent to the clients.
The LogRocket Redux middleware package adds an extra layer of visibility into your user sessions. LogRocket logs all actions and state from your Redux stores.
We have discussed the major features of Redux and why Redux is beneficial to your app. While Redux has its benefits, that does not mean you should go about adding Redux in all of your apps. Your application might still work well without Redux.
One major benefit of Redux is to add direction to decouple “what happened” from “how things change.” However, you should only implement Redux if you determine your project needs a state management tool.