top | item 24964185

(no title)

bbaumgar | 5 years ago

How can you apply this to debugging useEffect issues?

discuss

order

iaml|5 years ago

You 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.