// the find
jamiebuilds/unstated
State so simple, it goes without saying
Unstated is a minimal React state management library from 2018 that wraps React's own context API with a class-based Container abstraction. It gives you shared component state without Redux's boilerplate. The author has since superseded it with unstated-next, which uses hooks instead.
The Container class is genuinely easy to test in isolation — you just instantiate it and call methods, no render required. Dependency injection via `<Provider inject>` makes swapping containers in tests painless without any mocking framework. The setState returns a promise, which is a real improvement over React's callback-based API for async flows. The library is tiny and doesn't impose any architecture beyond 'put your state in a class'.
This is effectively abandonware — last meaningful activity was years ago and the author's own README points you elsewhere (unstated-next). The class-based API feels dated now that hooks are universal; anyone starting a project today would use Zustand, Jotai, or unstated-next instead. No devtools support out of the box, which makes debugging non-trivial state flows painful. The render-prop Subscribe pattern adds nesting noise that hooks eliminated, and it doesn't compose well when you need multiple containers.