3 ms·
The problem arises when you want to reuse a lifecycle function in multiple Stateful or even StatelessWidgets. For example, if you go to the bottom of the issue,
by satvikpendem 6y ago
The problem arises when you want to reuse a lifecycle function in multiple Stateful or even StatelessWidgets. For example, if you go to the bottom of the issue, I make an example where I needed to have an AnimationController with complex initState and dispose methods. With hooks I could encapsulate all of that and make it work with any Widget I wanted, I didn't have to rewrite it each time.
There are a lot more examples, it is worth going through the entire ~250 comments, even though it may take some time. I only understood after doing so, not necessarily by just reading the initial post.