Optional
Called to determine whether the change in props and state should trigger a re-render.
Component always returns true. PureComponent implements a shallow comparison on props and state and returns true if any props or states have changed.
Component
PureComponent
If false is returned, Component.render, componentWillUpdate and componentDidUpdate will not be called.
componentWillUpdate
componentDidUpdate
Called to determine whether the change in props and state should trigger a re-render.
Componentalways returns true.PureComponentimplements a shallow comparison on props and state and returns true if any props or states have changed.If false is returned, Component.render,
componentWillUpdateandcomponentDidUpdatewill not be called.