Skip to content

Instantly share code, notes, and snippets.

View soner8's full-sized avatar

Maco soner8

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