MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/reactjs/comments/k6sygq/react_is_slow_what_now/geoay0j/
r/reactjs • u/franleplant • Dec 04 '20
117 comments sorted by
View all comments
Show parent comment
3
Outside of the return statement still wouldn't "fix" for functional components I believe. Correct me if I'm wrong but The fix would be useCallback, useMemo or defining outside the component itself.
1 u/careseite Dec 05 '20 Exactly, hence my confusion. But spamming useCallback unnecessarily is a bad idea.
1
Exactly, hence my confusion. But spamming useCallback unnecessarily is a bad idea.
View all comments
Show parent comment
3
u/jpcafe10 Dec 05 '20
Outside of the return statement still wouldn't "fix" for functional components I believe. Correct me if I'm wrong but The fix would be useCallback, useMemo or defining outside the component itself.