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

The dependency array is the single most important improvement that hooks bring over lifecycle methods.

You're component gets rerendered when the array changes and not when you got the right mix of lifecycle methods going.

But yes, it's not always obvious what changes you really care for.



It actually reminds me of $scope.$watch from Angular 1.




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

Search: