Leigh Halliday is a full-stack developer specializing in React and Ruby on Rails. He works for FlipGive, writes on his blog, and regularly posts coding tutorials on YouTube.
Making a video player in React should be easy, right? A boolean value can keep track of whether it is playing or not... but has the video been loaded yet? And how can we determine if it is paused or if it has just reached the end of the track? A Finite State Machine can help us define these different states and how one transitions to the next. Using XState within React can help us make complicated UIs easier to understand.