Re:Understanding UseMemo and UseCallback
by darepublic on Saturday September 03, 2022 @10:59PM
(#32709340)
button is just a small lightweight element usually with a single string child. If passing a lightweight unwrapped click handler to a leaf node is a faux pas then honestly the react team needs to memoize by default. Your description "updating the dom every render..." And acting like indiscriminate useCallback is a panacea for your performance problems to me seems like a pretty naive take. But then again seems like the community opinion in this has shifted, I just honestly don't get it. And I do use useCallback btw, but only when I need to keep referential stability for known reasons,not as an automatic default
[ Parent
| on HN ]
There are no comments on this comment yet.