kentcdodds / use-deep-compare-effect

🐋 It's react's useEffect hook, except using deep comparison on the inputs, not reference equality
https://npm.im/use-deep-compare-effect
MIT License
1.88k stars 84 forks source link

Use with nullable non-primitives #45

Closed danielcrk closed 3 years ago

danielcrk commented 3 years ago

What would be the recommended approach to use the hook with nullable non-primitives? Currently, checkDeps throws an error if a dep is null.

kentcdodds commented 3 years ago

Rather than [nullableState], you could use: [{state: nullableState}]