Learn even more about XState.
Using React hooks are the easiest way to use state machines in your components. Use the official @xstate/react package to give you useful hooks out of the box.
XState is compatible with the SCXML (State Chart XML: State Machine Notation for Control Abstraction) specification.