First conceptualized many decades ago, a finite state machine is a mathematical model of a machine that as the name suggests, can maintain one of a finite number of states. This idea is generating a lot of buzz in the UI community as an effective way to model our component state. Let's take a look at how we can use state machines in our React apps by building a simple toggle machine.

Read