This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* A "pure" component means that the render function only depends on props and state, | |
* which allows us to add performance optimizations (see `shouldComponentUpdate` below). | |
*/ | |
class PureComponent<P, S> extends React.Component<P, S> { | |
shouldComponentUpdate(nextProps: P, nextState: S): boolean { | |
return !shallowEqual(this.props, nextProps) || | |
!shallowEqual(this.state, nextState); | |
} | |
} |