Skip to content

Latest commit

History

32 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

~50 State Management Libraries & Frameworks

You can manage your state with React local state (setState), hooks and context, but often that's not ideal for complex applications. So far the most common choice for state management there has been Redux, but there are many other alternatives. Inspired by various posts about the state of state management in JavaScript, we decided to compile a thorough list of options and compare them in the categories we care about.

Explanation of columns:

  • GitHub stars - we're using this as a rough measure of popularity. We know it's not perfect, and it might become out of date with time. We also considered using NPM downloads, GitHub "used by" or watchers, etc., but this was the simplest way to start.
  • TypeScript support - we care about TypeScript. Most libraries that offer good support for it will mention it in their README or docs, and that's what we looked at to fill this column.
  • Performance - we didn't run and test performance for all of these, so this is also based on what they say in their documentation. Other people have benchmarked different frameworks, for example here.
  • API Complexity - the APIs vary from simple and easy to learn, to complex and full of boilerplate. At the moment this field will often link to the API documentation that you can check for yourself, but we are working on filling it in more directly. For now, we're adding a couple broad categories: simple, medium and complex. These are a little bit subjective, so let us know if you disagree.
  • Abstract Concepts - this is a list of concepts you'll need to learn to use this framework.
  • Extensibility - how easy is it to customize and extend the framework with either middleware, plugins or otherwise?
  • Devtools - does the framework come with its own developer tools, loggers, or integrate with existing (usually Redux) developer tools?
  • Time travel - do the devtools offer time travel functionality? If you're not familiar with this, you can check the Redux example here).
  • Automation - TBD

This table is roughly ordered by number of GitHub stars, but we’ve also grouped some related libraries together, for example different MobX variations. If any field is enclosed in "double quotes", it's a quote taken directly from their README or docs.

To see how Prodo compares, see our README.

Contributions

There's a lot of information to keep track of here, so it's entirely possible we got something wrong, or it went out of date. If you spot a mistake, or want to add a new entry to the table, please make a PR! We welcome comments and suggestions.

Comparison Table

Compiled in October 2019. A version of this page with a table you can filter is here.

Framework/LibraryNotesLinkGitHub StarsTypeScript supportPerformanceAPI ComplexityAbstract conceptsExtensibilityDevtoolsTime travelAutomation
Reduxhttps://github.com/reduxjs/redux (https://github.com/reduxjs/react-redux)51k (18.2k)https://redux.js.org/recipes/usage-with-typescript#usage-with-typescript (yes, but adds a fair bit of boilerplate/effort)https://redux.js.org/faq/performanceComplex (https://redux.js.org/api/api-reference)actions, action creators, reducers, store, dispatch, thunk, saga, observable…Middlewarehttps://github.com/reduxjs/redux-devtoolsyes
MobXhttps://github.com/mobxjs/mobx (https://github.com/mobxjs/mobx-react)20.7k (3.9k)not mentionedNot discussed much in docs; a bit worse than Redux in https://krausest.github.io/js-framework-benchmark/current.html (looking at react-mobx, not mobx-jsx)Complex (https://mobx.js.org/refguide/api.html)decorators, observable state, computed values, reactions, actionsnot mentionedhttps://github.com/mobxjs/mobx-devtoolsno
MobX State Treedifferent from MobXhttps://github.com/mobxjs/mobx-state-tree4.8k“Typescript typings are included in the packages.”"If you have a performance critical application that handles a huge amount of mutable data, you will probably be better off by using 'raw' MobX…”Complex (https://github.com/mobxjs/mobx-state-tree#api-overview)tree, node, type, state, model, actions, viewshttps://github.com/mobxjs/mobx-state-tree/blob/master/docs/middleware.mdSupports MobX DevTools, Reactotron or Reduxyes
Parketheavily isnpired by mobx-state-tree, but smallerhttps://github.com/ForsakenHarmony/parket408not mentionednot mentionedMedium? (heavily inspired by mobx-state-tree, but smaller)proxies, symbols, decorators, observe, connect, unistorenot mentionednono
Remxopinionated MobXhttps://github.com/wix/remx113not mentionedtalks about MobX but not specifically this libraryRelatively simple (https://github.com/wix/remx#api)implements redux (flux) architecture in MobX, state, getters, setters, connectnomaybe MobX? + logger/debuggerno
Unstatedhttps://github.com/jamiebuilds/unstated6.9knot mentioned much, some types existnot mentioned“Simple”container, subscribe, providernot mentioneddebugger: https://github.com/sindresorhus/unstated-debugno
Unstated-nexthttps://github.com/jamiebuilds/unstated-next1.5kwritten in typescriptClaims to be faster than Redux in the docsBased on hooks, so should be easy to learncontainer, hooksnot mentionedno?no
Constatehooks + contexthttps://github.com/diegohaz/constate2.1khas an examplenot mentionedSimple (https://github.com/diegohaz/constate#api)hooks, contextnot mentionednono
Unistorehttps://github.com/developit/unistore2.6knot mentionednot mentionedSimple (https://github.com/developit/unistore#api)store, actionsnot mentionedSupports Redux devtools extension?
StockroomUnistore in a workerhttps://github.com/developit/stockroom1.6knot mentionednot mentioned much (performance demo)Simple (https://github.com/developit/stockroom#api)unistore, worker, stockroom modulenot mentionedno (although can use Redux devtools extension for Unistore?)no
React Copy Writehttps://github.com/aweary/react-copy-write1.8knot mentionednot mentionedSimpleimmer, immutable state, mutate, optimized selectornot mentionednono
Redux Zerohttps://github.com/redux-zero/redux-zero1.8khttps://github.com/redux-zero/redux-zero#typescriptnot mentionedSimplestore, actions, no reducershttps://github.com/redux-zero/redux-zero#middlewareYes + integrates with Redux DevTools?
Fr(e)actalhttps://github.com/FormidableLabs/freactal1.7knot mentionednot mentionedMedium (https://github.com/FormidableLabs/freactal#api-documentation)provideState, injectState, effects, intermediate state, computed values, multiple statesnot mentionednono
Easy React Statehttps://github.com/solkimicreb/react-easy-state1.6knot mentioned"It performs a bit better than MobX and similarly to Redux.” (https://github.com/krausest/js-framework-benchmark)Simplestore, viewnot mentionednono
Rewormhttps://github.com/pedronauck/reworm1.4khas typingsnot mentionedSimple https://github.com/pedronauck/reworm)provider, get & set, selector, subscribenot mentionednono
Unduxhttps://github.com/bcherny/undux1.3k“Complete type-safety, no exceptions”not mentionedSimple (get, set)store, container, effects, subscriptions = Rx observablesPluginsLogger + Supports Redux DevTools extensionyes
Microstatescomposable state primitiveshttps://github.com/microstates/microstates.js/ (https://github.com/microstates/react)1.3k (45)(different composable / transpilation free type system)not mentionedMedium - complexmicrostates, transitions, state machinesnot mentionednono
Apollo Link Statenow in Apollo Client corehttps://github.com/apollographql/apollo-link-state1.4kApollo provides tools to generate typesMedium (https://www.apollographql.com/docs/link/links/state/)https://github.com/apollographql/apollo-client-devtoolsno
React automata + setStatehttps://github.com/MicheleBertoli/react-automata1.2knot mentionednot mentionedSimple - medium (https://github.com/MicheleBertoli/react-automata#api)state machines, xstate, transition, Action, Statenot mentionedCan connect to Redux DevTools Extension (if using with Redux?)?
Storeonhttps://github.com/storeon/storeon1.1k"Storeon delivers TypeScript declaration which allows to declare type of state and optionally declare types of events and parameter.""Fast. It tracks what parts of state were changed and re-renders only components based on the changes."Simple - mediumstore, events, init, dispatch, changed, hooks - useStoreon, connectnot mentionedLogger + "supports debugging with Redux DevTools Extension"no
Overmindhttps://github.com/cerebral/overmind680"Overmind is written in Typescript and it is written with a focus on you dedicating as little time as possible to help Typescript understand what your app is all about.”(they don’t talk about perfomance much)Medium (https://overmindjs.org/api/action?view=react&typescript=false)state, actions, effects, operatorsnot mentionedyesno
Dobhttps://github.com/dobjs/dob651not mentionednot mentionedSimple - mediumproxy, decorators: observable, inject, Connect, Actionnot mentionedhttps://github.com/dobjs/dob-react-devtools (also can bind to redux?)no
Stattyhttps://github.com/vesparny/statty519not mentionednot mentionedSimple (https://github.com/vesparny/statty)Provider, State, selector, updaternot mentionednono
SatchelJSto use with React, add MobXhttps://github.com/Microsoft/satcheljs339Written in TypeScript, examples assume it“Satchel enables a very performant UI, only rerendering the minimal amount necessary. MobX makes UI updates very efficient by automatically detecting specifically what components need to rerender for a given state change.”Mediumstore, observer decorator, action creator, dispatch, murator, orchestrator, mutatorActionnot mentionedmaybe MobX?no
ReComponentreducer componentshttps://github.com/philipp-spiess/react-recomponent269“Comes with TypeScript definitions built-in.”not mentionedRelatively simple (https://github.com/philipp-spiess/react-recomponent#api-reference)reducer components, effectsnot mentionednono
React Recollectsimilar to react-easy-statehttps://github.com/davidgilbertson/react-recollect250https://github.com/davidgilbertson/react-recollect#usage-with-typescriptnot mentionedMedium (https://github.com/davidgilbertson/react-recollect#api)immutable store, collect, selector, updaternot mentioneddebuggerno
Controllerimhttps://github.com/Niryo/controllerim196not mentioned“Controllerim utilizes Mobx behind the scenes for all the performance boosts (Memoizes values, calculates dependencies and renders only when trully needed)”Simple - medium (https://github.com/Niryo/controllerim#api)controller, observernot mentionedmaybe MobX?no
Lacohttps://github.com/deamme/laco162not mentionednot mentionedMedium (https://github.com/deamme/laco#api, inspired by redux and unstated)inferno, store, actions, subscribePartially supports Redux devTools and React Native debuggeryes
Reatomhttps://github.com/artalar/reatom147"static typed: best type inferences""performant updates for partial state changes"Medium - complex (https://artalar.github.io/reatom/#/faq?id=why-is-api-so-strange-can39t-it-be-simpler)atom, action, store, dispatch, subscribe, observable,nono
Pure Storehttps://github.com/gunn/pure-store102“It also works excellently with typescript.”not mentioned“Simple”store, update, subscribenot mentionednono
Tiny Atomhttps://github.com/KidkArolis/tiny-atom90not mentioned“highly optimised with batched rerenders”“tiny api - easy to understand, easy to adapt” (https://kidkarolis.github.io/tiny-atom/api-reference/)atom, actions, async actions, connect, provider, consumer, updater,custom evolve hookLogger + Redux DevTools integration
Alfahttps://github.com/lsm/alfa80not mentioned“Fast – Alfa wraps your components with a thin layer. It introduces little to no performance impacts.”“Only 4 functions/APIs to learn” (https://lsm.github.io/alfa/#/?id=api)inject, subscribe, provide, actions, dynamic keys, storenot mentionednono
Reimhttps://github.com/IniZio/reim79“Typing support for Typescript & Flow”not mentionedSimple - mediumimmer, immutable state, store, snapshot, actions, Statenot mentionedSupports Redux Dev Tools?
React Recontexthttps://github.com/minhtc/react-recontext78not mentionednot mentionedSimple (https://github.com/minhtc/react-recontext#api)store, provider, actions, action creators, connect, dispatchnot mentionedLoggerno
Pullstatehttps://github.com/lostpebble/pullstate75"Built with Typescript, providing a great dev experience if you're using it too.”not mentionedSimplestore, update, subscriptions, reactions, async actions, immernot mentionednono
Prodohttps://github.com/prodo-dev/prodo67"First class support for TypeScript""Blazingly fast re-rendering""Absolutely minimal boilerplate"model, store, watch, dispatch, actionshttps://docs.prodo.dev/basics/plugins/https://docs.prodo.dev/basics/devtools/WIPTBD
Dakpanhttps://github.com/houfio/dakpan64“TypeScript types come bundled”not mentionedRelatively simple (https://dakpan.houf.io/usage.html)hooks, actionsnot mentionednono
Hookstatehttps://github.com/avkonst/hookstate44"First-class Typescript support. Complete type inferrence for any complexity of structures of managed state data. Full intellisense support tested in VS Code.”“Incredible performance based on unique method for tracking of used/rendered and updated state segments.” (https://hookstate.netlify.com/performance-demo-large-table …)Mediumglobal, local and scoped statehttps://github.com/avkonst/hookstate#pluginsnono
ClearXhttps://github.com/Autodesk/clearx40not mentionednot mentioned"ClearX has a familiar API." (https://github.com/Autodesk/clearx#api)store, paths,not mentionednono
Refnuxhttps://github.com/algesten/refnux36not mentionednot mentionedSimple - mediumlike redux but functions instead of reducersnot mentionednono
Statorhttps://github.com/cs01/stator26not mentionednot mentioned“Intuitive, Small API: Similar to React's, with no boilerplate necessary” https://github.com/cs01/statorstore, subscriptionsMiddlewarenono
Hezhttps://github.com/linq2js/hez21not mentionednot mentionedMediumstore, actions, hooksnot mentionednono
Sunfishhttps://github.com/tzilist/Sunfish17not mentioned“Updating React can be expensive. Updates to state only happen when the developer deems it necessary.”"Sunfish has a fairly intuitive, functionaly driven api." (https://github.com/tzilist/Sunfish#api)transaction, pipenot mentionednono
Elfihttps://github.com/madx/elfi16not mentionednot mentionedSimplestore, dispatch, subscribeMiddlewareLoggerno

Some other state-related libraries that haven't made it into the table:

About

Comparison of JS state management libraries and frameworks

Resources

Stars

12 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages