Consider the following simple components:
import React, { Fragment, memo } from 'react'; function Parent(props) { return ( <Fragment> <Child {...props} /> <Child foobar={props.foobar} /> </Fragment> ); } export default memo(Parent); import React, { memo } from 'react'; function Child({ foobar }) { return ( <p>{foobar}</p> ); } export default memo(Child); From what I understand wrapping a component in React.memo() will ensure that it only gets re-rendered whenever its props changes.
So unless whatever props that is passed onto "Parent" changes, that component, and its entire lineage of children will not get re-rendered.
However, what about its two children? Understandably if "props.fooobar" changes, they both will get re-rendered. But what if "props.somethingElse" gets changed? Which of them will get re-rendered here?