updateIfChanged
is a pattern that allows preventing updates based on a unique key.
It inverts control of updates from a dumb child to the smarter parent. It's particularly useful because
it can avoid the normal issue of children and callbacks causing a rerender when it's not truly required.
The alternative workaround is usually memoizing the children and callbacks which can be expensive, complicated, and leak memory.
import deepEqual from 'lodash/isEqual';