DEV Community

Discussion on: How to write more performant functional React Components

Collapse
stereoplegic profile image
Mike Bybee

I'm gonna have to disagree. That's premature optimization, and potentially a cure worse than the disease in terms of memory overhead. Reach for useMemo and/or useCallback when rerenders are causing perf issues, and look to things like more localized context (if you're using it), offloading expensive computations to web workers, etc. first.

Collapse
stereoplegic profile image
Mike Bybee

The Kent C. Dodds article @exclipy shared is an excellent resource, BTW.