> Hooks allow you to bundle code together by functionality, and consequently allow you to easily extract and share said functionality in a very composable way.
You’re using React. The mechanism that enables code reusability is through composing components.
There’s nothing wrong with class components even for the most complex logic. The only downside is the community has moved on and mostly adopted hooks and functional components.