Created
June 28, 2022 22:25
-
-
Save mendes5/aec200f4eb6cbbe86290b8f3c329dc23 to your computer and use it in GitHub Desktop.
Helps debugging react hooks re-render reasons
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const useDebug = (deps: Record<string, any>) => { | |
| Object.entries(deps).forEach(([key, value]) => { | |
| useEffect(() => console.log(`${key} Changed`), [value]); | |
| }); | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment