# XState

12 Hacker News commenters recommended XState and 3 criticized it, November 2025 to November 2026. It was recommended in 4 of 13 months. It meets the Hacker Approved badge rule.

**Verdict:** Recommended for building state machines and statecharts in JavaScript and TypeScript, with a visualizer and simulator that people praise; critics find its syntax verbose and hard to learn.

## Why people recommend it

- Handles complex state logic well (4 comments): "XState is awesome, made a complex decentralized key sharing scheme a breeze." ([source](https://news.ycombinator.com/item?id=47911188)) "Xstate has helped me clean up some hairy situations in the past" ([source](https://news.ycombinator.com/item?id=47910803)) "I can't even think how horrible it'd have been without XState." ([source](https://news.ycombinator.com/item?id=47909896))
- Well-designed, intuitive API (2 comments): "Think Xstate machines are a little more intuitive than the conditional value structuring displayed here" ([source](https://news.ycombinator.com/item?id=47500600)) "It's a really well-designed API." ([source](https://news.ycombinator.com/item?id=46951605))
- Treats statecharts as executable behavior (2 comments): "statecharts are most valuable when they're treated as executable behavior, not just documentation." ([source](https://news.ycombinator.com/item?id=47909586)) "state machines are the truth!" ([source](https://news.ycombinator.com/item?id=47243185))
- Widely praised as excellent library (3 comments): "bring such a powerful concept to the world" ([source](https://news.ycombinator.com/item?id=47910904)) "XState is an excellent option." ([source](https://news.ycombinator.com/item?id=47327840)) "XState is an awesome library!" ([source](https://news.ycombinator.com/item?id=47910477))

## What people warn about

- Verbose, complex syntax to learn (2 comments): "libraries like xstate are far more difficult to learn the syntax and are more verbose" ([source](https://news.ycombinator.com/item?id=47909446)) "the accidental complexity of how we worked with xstate" ([source](https://news.ycombinator.com/item?id=47910660))
- Overkill unless nested state is needed (1 comments): "if you don't need complex nested state machines, you should check out robot3.js" ([source](https://news.ycombinator.com/item?id=47910942))
- Hard to retrofit into existing systems (1 comments): "they were hard to retrofit to existing systems" ([source](https://news.ycombinator.com/item?id=47910195))

## Alternatives hackers recommend

- [TanStack Query](https://hackerapproved.com/p/tanstack-query.md): 19 recommend
- [Redux](https://hackerapproved.com/p/redux.md): 15 recommend
- [Zustand](https://hackerapproved.com/p/zustand.md): 12 recommend
- [MobX](https://hackerapproved.com/p/mobx.md): 7 recommend
- [Pinia](https://hackerapproved.com/p/pinia.md): 6 recommend

## Cite as

Hacker Approved, "XState", https://hackerapproved.com/p/xstate/ (counts from 1,795,640 Hacker News comments, November 2025 to November 2026).
