Created
July 9, 2018 05:46
-
-
Save ManasJayanth/25027a2a91b70e7b154c4096c7901ebb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
prepareUpdate( | |
domElement, | |
type, | |
oldProps, | |
newProps, | |
rootContainerInstance, | |
hostContext | |
) { | |
const propKeys = new Set( | |
Object.keys(newProps).concat( | |
Object.keys(oldProps) | |
) | |
).values(); | |
const payload = []; | |
for (let key of propKeys) { | |
if ( | |
key !== 'children' && // text children are already handled | |
oldProps[key] !== newProps[key] | |
) { | |
payload.push({ [key]: newProps[key] }) | |
} | |
} | |
return payload; | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment