yeyuguo
4/5/2017 - 2:11 AM

react 组件是否应该更新

react 组件是否应该更新

import { is, fromJS} from 'immutable';


function shouldComponentUpdate(nextProps, nextState) {
      return !is(fromJS(this.props), fromJS(nextProps)) || !is(fromJS(this.state),fromJS(nextState))
}