Skip to content

Instantly share code, notes, and snippets.

@viclotana
Created October 25, 2018 15:25
Show Gist options
  • Save viclotana/1b92e97ead5e584620947c8dc02462ce to your computer and use it in GitHub Desktop.
Save viclotana/1b92e97ead5e584620947c8dc02462ce 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