Hacker News new | ask | show | jobs
by unityByFreedom 2055 days ago
> I too can't shake the feeling that hooks are off.

Well the alternative to hooks is componentDidMount, componentDidUpdate, etc. It's a lot easier to sync state and UI when the logic for doing so can be put in one place.

1 comments

I’ve been using hooks for a year, and they are awesome (once you get used to it). I can write the same component in 1/3 of the code in a functional style.

The debugging story isn’t great if you expect to be able to use breakpoints.

It’s all about putting console.log wherever really.

The beauty comes in the speed of coding, I can move so fast that I always build a mock version of my api layer and can have the entire UI done rapidly.

You can throw in debugging statements (`debugger;`) when some hook doesn't seem to be hitting a breakpoint. Stops things just fine.