Refactoring a Class Component to a Functional Component in React, with Hooks

Hooks were introduced a little more than two years ago, when Facebook released React 16.8 in February 2019. Many software engineering students still learn React workflows using class components before shifting over to hooks, and the transition can be a little confusing.