Skip to content

Instantly share code, notes, and snippets.

@misha-erm
misha-erm / determine-changed-props.js
Created October 3, 2019 15:30 — forked from sorenlouv/determine-changed-props.js
Determine which props causes React components to re-render
import React from 'react';
export default function withPropsChecker(WrappedComponent) {
return class PropsChecker extends React.Component {
componentWillReceiveProps(nextProps) {
Object.keys(nextProps)
.filter(key => {
return nextProps[key] !== this.props[key];
})
.map(key => {