We’ll look at useStateMachine—a very lightweight but powerful state machine hook for React applications. Essentially combining useReducer and useEffect, it comes with many advanced features such as entry and exit callbacks, guarded transitions, extended state, etc.