5 ms·
How can you apply this to debugging useEffect issues?
by bbaumgar 6y ago
How can you apply this to debugging useEffect issues?
- iaml 6y agoYou can set breakpoint inside useEffect and it will work as expected, you can use something like if (somevar === 42) debugger; and you'll see all of the internal call stack and all variables in scope. moreover you can use the console to evaluate your code. Worth mentioning 99% of strange issues in react (in my experience) are caused by mutation or not declaring all deps in hooks.