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

I agree with the others. I've started using hooks since they were introduced and I've only hit the re-render issue only a few times, which I promptly fixed as they were caused by carelessness. My strategy is to not use a single useEffect, but multiple ones for each (which reduce greatly the dependencies). Also, avoiding dependency circles between useState and useEffect.

I've used class components and I think hooks are much better than the monstrosity that the lifecycle methods would usually become.

Also defining functions inside other functions is very much the staple of functional programming.



>Also defining functions inside other functions is very much the staple of functional programming.

Isn't the difference that JavaScript runtimes don't compile them away unlike functional runtimes?




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

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

Search: