On this page
I have written in the past about my hate of Redux. I’m also a huge fan of Remix which makes client-side state management largely redundant
That said there are still scenarios where state management is a core requirement on the front and backend. In these scenarios, I reach for XState and write a state machine.
State Visualised
One of my favourite things about XState is that it visualises state logic. Not only is this incredibly helpful when developing but is fantastic for documenting and sharing with the rest of your team.
A state machine is live code but it can also be visualised and interacted with as it is developed.

There is now even a Stately Visualiser which gets better all the time and can be used directly within VSCode.
Learning Curve
Writing state machines does involve a bit of a learning curve and it is true that you initially have to spend quite a bit more time thinking about your application state and the various states your application could get into. This is very much a good thing! It is when you spend little time thinking about state and chuck for example Redux into your application with little thought of application state that you get problems.
Final Thoughts
When your state is encapsulated in a state machine it is language agnostic and be easily moved between applications. It is also easy to visualise, rationalise and communicate to others what the application does. Not to mention testing your state becomes a lot easier.
My prefered option is to reach for a framework like Remix to avoid state as much as possible but when I have to write complicated state flows, I use XState.