react-computed-props
react-computed-props copied to clipboard
Idea: Include a change digest
It would be cool to give an object that listed props as keys and true/false if they changed or not. This would enable components to check if certain subset of props changed and then only update those subsections. For example, if the component has props a
, b
, and c
, and b
and c
change, then it would receive another prop propChanges
:
{
a: false,
b: true,
c: true
}
Or maybe it's better to exclude props that did not change, so Object.keys() returns the number of changes.
{
b: true,
c: true,
}