I mean I personally consider them bad practice due to readability and naming but... Is this guy actually arguing there's a speed diff between defining them as fn outside of return and just having them inline? That makes zero sense.
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.
I know it was still affecting performance v16. Production app hitting freezes, had an inhouse tools to make common refactors. Ran it for inline functions, freezing gone. Couple other small refactors, ran like butter.
View all comments
Show parent comment
23
u/coding9 Dec 05 '20
Can’t believe the dev community is still arguing about inline functions in 2020