In terms of state handling in a react functional context, I think the hooks API makes things a lot more simple and easier to encapsulate concepts.
However, I agree with you that this could be considered an anti-pattern. Other state handling libraries (either built-in (think Svelte or Vue in their recent incarnations or standalone) use the concepts of stores (readable/writables), which not only overcome the weird hook dances, like rules about where you have to use and declare hooks, leaving you with state handling as just another primitive.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
In terms of state handling in a react functional context, I think the hooks API makes things a lot more simple and easier to encapsulate concepts.
However, I agree with you that this could be considered an anti-pattern. Other state handling libraries (either built-in (think Svelte or Vue in their recent incarnations or standalone) use the concepts of stores (readable/writables), which not only overcome the weird hook dances, like rules about where you have to use and declare hooks, leaving you with state handling as just another primitive.