3 ms·
The dependency array is the single most important improvement that hooks bring over lifecycle methods. You're component gets rerendered when the array changes
by k__ 7y ago
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.
- matsemann 7y agoIt actually reminds me of $scope.$watch from Angular 1.