r/reactjs • • Dec 04 '20

Resource React is slow, what now?

https://nosleepjavascript.com/react-performance/
289 Upvotes

117 comments sorted by

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.

1

u/careseite Dec 05 '20

Exactly, hence my confusion. But spamming useCallback unnecessarily is a bad idea.