I am trying to refactor my existing code to use Hooks instead of constructors, componentDidMount(), componentDidUpdate(). My original code below did this just fine: