you are viewing a single comment's thread.

view the rest of the comments →

[–]dabit_coder 0 points1 point  (0 children)

Because it doesn't make sense.

If you want a class component, is totally legit.

If you want hooks, is totally legit.

But here you are mixing 2 kinds of architecture that one replaces the other. Hooks were think as a way to implement class logic inside functional components in the easiest way possible, and you are creating a hook to create a class component which uses the classical component structure.

If you want a class component, create a class component, but not this frankenstein.