Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You are probably a Javascript dev, not doing typescript? Classes were horrible to type for, especially when you tried higher-order components. Hooks removed so much clutter and friction and allows pretty well-typed components and higher order functions (i.e. hooks that return components).


Hooks made simple things simpler, but hard things harder, code with lots of boilerplate was replaced with code with leaky abstractions full of various workarounds - I don't think this is a good trade.

While I hate class component lifecycle methods they are much better than complex hook setups when solving more advanced problems.


Could you elaborate why you dislike lifecycle methods? I read this take a lot and I use mainly angular but did some smaller projects with react class components and with function components. I also think function components are very counter intuitive but I also never had anything against lifecycle methods.


They often require quite complex ifology for simple use cases. Also didmount and diduptade often needs to be overriden together only to have almost the same implementation. They also have some gotchas regarding state updating inside them.


Just having an interval inside a component used to be trivial, but with hooks becomes tedious. Only the barebones simple ultra basic stuff became simple. Everything else? Harder.


Yes, they were uglier but they had advantages that got lost such as an easy to control rendering life cycle.

Just opening dev tools on MIT-written big tech corps and startups confirms nobody is able to write good websites or applications that arent filled with performance and memory leaks.


I am all around developer, working with typescript from at least 2015.

I’m not exactly sure what complication you mean. Lifecycle method sucks, yeah, but you replaced them with lifecycle hooks. So the same mental overhead but now in a pseudo stateless functions, with state full escape hatches.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: