PHPnews.io

Use React.memo() wisely [link]

Written by Remy Sharp / Original link on Oct. 6, 2020

A useful focused post on React's memo function. Since moving away from classes (and forcing?) to use pure components with hooks, methods like shouldComponentUpdate can be a bit of a black box.

This post reminds me that all components are re-rendered (in memory at least) unless memo is used, and some of the pros and cons and use cases (and when you don't want to use it).

Frankly, doing "modern web dev" is a bit of minefield of these things...

Source: dmitripavlutin.com

Originally published on Remy Sharp's b:log

remysharp

« Billing access to your Laravel apps with Gumroad - Practice Typing by Rewriting Classic Literature »