The main difference, as I see it, is that a component rerenders every time its parent rerenders, regardless of whether the component's props and state have changed.
A pure component, on the other hand, will not rerender if its parent rerenders, unless the pure component's props (or state) have changed.
For example, lets say that we have a component tree with a three-level hierarchy: parent, children and grandchildren.
When the parent's props are changed in a way that the props of only one child are changed, then:
- if all components are regular components, then the entire component tree will rerender
- if all children and grandchildren are pure components, then only one child will rerender, and one or all of its grandchildren, depending on whether their props are changed.
If there are many components in this component tree, it may mean a significant performance boost.
Sometimes, however, using pure components will not have any impact. I had such a case when the parent received its props from a redux store and needed to perform a complex calculation of its children's props. The parent used a flatlist to render its children.
The outcome was that every time there was even a small change in the redux store, the entire flatlist array of the childrens' data has been recalculated. This meant that for every component in the tree, the props were new objects, even if the values didn't change.
In this case, pure components don't help, and the performance boost can be achieved only by using regular components and checking in the children, in shouldComponentUpdate, if a rerender is needed.