Debugging useEffect Issues Made Simple

preview_player
Показать описание
useEffect causes us a ton of grief. So let me show you a method that I use to figure out which useEffect is causing the problem and then which dependencies in the dependency array are the culprit. The extension is Console Ninja, and it's free.

#shorts
Рекомендации по теме
Комментарии
Автор

Struggling with useEffect, is solving problems that are not present in other JavaScript frameworks ;)

ukaszrozewicz
Автор

Didn't know about console ninja; that makes run away code so obvious. Great tip!

SkylerA
Автор

Ive only ever used one useEffect in any component. Please do more of these hook pros and cons with debugging! Lvoe them!

PostMeridianLyf
Автор

yeah, after some issues, you learn not to use "state" and its corresponding "setState" simultaneously inside useEffect, at least not without additional conditions preventing an infinity loop )

lerdev
Автор

Using Google chrome debugger and usually add a breakpoint to the inner scope of the useEffect to be able to know when and what causes it to be stuck in a loop

SysmKzz
Автор

useEffect inside components in general creates a lot of bugs, it has been recommended millions of times to use the general states of the application for general states, and to implement local states by requesting values from the general states.

eugenex
Автор

That's a good way. I used this way before and I could debug fast when I had error. Thank you.

PhucNguyen
Автор

This is super handy! Learning a lot from you!

MrSca
Автор

Wow! Can you tell us what kind of extension for showing that console.log output?

hasbiassidiki
Автор

Exactly what I needed to know, thanks

ToddsDiscGolf
Автор

How did you know that you have a problem in the useEffect from the beginning?

vedmack
Автор

what vscode theme is that? looks awesome

Elijah
Автор

Please share me the full video of thiss

adamjamiu
Автор

Instead of debugging useEffect I prefer to use eslint-plugin-react-hooks to fix errors before I even save the code 👍

ofadiman
Автор

pretty sure there's a lint rule for this. (when a react hook is a dep and has dispatch called)

harryscheuerle
Автор

what extension did you use for that effect on ur code for the console numbers?

LbovboE
Автор

I tend to use breakpoints and debugger ran on webstorm for most of my tricky react bugs. Step through the code and debug it.

Kelz_codes
Автор

Con you please tell me your VScode theme name

zatakzataks
Автор

What vs code extension we need to use for that console re rendering ?

jmeahra
Автор

What is the name of this vscode extension that counts renders

adamjamiu
visit shbcf.ru