Skip to content

Instantly share code, notes, and snippets.

@AndrewIngram
Created January 29, 2015 00:44
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save AndrewIngram/089ce89a8c60f96317c0 to your computer and use it in GitHub Desktop.
Save AndrewIngram/089ce89a8c60f96317c0 to your computer and use it in GitHub Desktop.
import React from 'react';
import shallowEqual from 'react/lib/shallowEqual';
class PureRenderComponent extends React.Component {
shouldComponentUpdate(nextProps, nextState) {
return !shallowEqual(this.props, nextProps) || !shallowEqual(this.state, nextState);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment