UNPKG

322 BJavaScriptView Raw
1import { shallowEqual } from '@tarojs/utils'
2
3import Component from './component'
4
5class PureComponent extends Component {
6 isPureComponent = true
7
8 shouldComponentUpdate (nextProps, nextState) {
9 return !shallowEqual(this.props, nextProps) || !shallowEqual(this.state, nextState)
10 }
11}
12
13export default PureComponent