Skip to content

Latest commit

 

History

History
12 lines (8 loc) · 369 Bytes

use-hash-compare.md

File metadata and controls

12 lines (8 loc) · 369 Bytes

useHashCompare

Tracks the hashed value of a given argument (using useHash) from a previous render, then returns a boolean indicating whether the hash has changed.

Example

const someDerivedState = { /* a complex, deeply-nested, non-memoized object */ };

const hashDidChange = useHashCompare(someDerivedState);
// => true | false