This video explains why you should be using xState and state machines when developing UI components. We start with a contact form component where we control the flow using booleans, explain why that's a faulty approach, and then show the billion times improved way you could do it using xState and state machines. Sandbox:
Hide player controls
Hide resume playing