I think state machines are a great fit for front-end development and they have been a part of my toolkit for over a year now. There are great FSM implementations out there, such as xstate and Robot, and they work well with React applications at scale, making complex user flows easier to implement. Lately however I have become more hesitant about bringing them into the workflow, without a strong enough justification, as they seem to bloat up the code with extra boilerplate and often interfere with the way I reason about interfaces and the role they play in user interaction with the application store/state.

  1. An error is not always a global state
  2. Pending transitions should not require an intermediary state
  3. State management should not be a bottleneck

#javascript

Rethinking State Machines in React
1.05 GEEK