Use Deep Compare
Use Deep Compare - React hooks, except using deep comparison on the inputs, not reference equality. Read about Hooks feature.
Installation
Note: React 16.8+ is required for Hooks.
With npm
npm i use-deep-compare
Or with yarn
yarn add use-deep-compare
Usage
useDeepCompareEffect
;; { ; return <div>/* render significant thing */</div>;}
useDeepCompareCallback
;; { const callback = ; return <div>/* render significant thing */</div>;}
useDeepCompareMemo
;; { const memoized = ; return <div>/* render significant thing */</div>;}
Credits
- Inspired by use-deep-compare-effect.