Skip to content

Instantly share code, notes, and snippets.

View PabloLION's full-sized avatar
🔍
Looking for half-time job

Pablo LION PabloLION

🔍
Looking for half-time job
  • Barcelona, Spain
View GitHub Profile
@albertorestifo
albertorestifo / propdiff.js
Created April 12, 2017 15:55
Logs the diff between current and previous props on a react element
componentDidUpdate(prevProps) {
console.log('Rrow update diff:');
const now = Object.entries(this.props);
const added = now.filter(([key, val]) => {
if (prevProps[key] === undefined) return true;
if (prevProps[key] !== val) {
console.log(`${key}
- ${JSON.stringify(val)}