pure()
can be used as a higher order function or a decorator.
When passed a pure functional component, it wraps the function in a classful Component with a shouldComponentUpdate()
that ignores renders for unchanged props.
When passed a classful Component, it injects a shouldComponentUpdate()
method into the Component's prototype that ignores renders for unchanged props & state.
import pure from 'pure-component';