Instantly share code, notes, and snippets.

Embed
What would you like to do?
REA ReactJS Performance Debugging "WhyYouUpdate Higher Order Component"
const WhyYouUpdate = Component => {
class WhyYouUpdate extends React.Component {
componentDidUpdate(prevProps, prevState) {
deepDiff(
{ props: prevProps, state: prevState },
{ props: this.props, state: this.state },
Component.displayName
);
}
render() {
return <Component {...this.props} />;
}
}
return WhyYouUpdate;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment