shallow-compare-without-functions

Shallow compare for React components where functions are excluded

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
shallow-compare-without-functions
600.0.28 years ago8 years agoMinified + gzip package size for shallow-compare-without-functions in KB

Readme

shallow-compare-without-functions
!Travisbuild-badgebuild
Just like React addons shallowCompare except it ignores functions. It's not uncommon to want to bind to a instance function or wrap and action creator. The problem with doing this is that even if the value props don't change, using a new function will trigger a re-render, making it a bad idea to use shallowCompare in that case. Additionally, the actual behavior of those functions almost never changes.
See this demo for an example.