Skip to content

Instantly share code, notes, and snippets.

@pomber
Created October 24, 2018 15:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pomber/304f510a86bc185be9176f62aeaedae5 to your computer and use it in GitHub Desktop.
Save pomber/304f510a86bc185be9176f62aeaedae5 to your computer and use it in GitHub Desktop.
function MyComponent(props) {
/* render using props */
}
function areEqual(prevProps, nextProps) {
/*
return true if passing nextProps to render would return
the same result as passing prevProps to render,
otherwise return false
*/
}
export default React.memo(MyComponent, areEqual);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment