DEV Community

loading...

Discussion on: React useEffect() hook tutorial for begginers

Collapse
lyrod profile image
Lyrod

Is clean up exemple really works? Because resizeD is a new instance every render?

Collapse
ratuloss profile image
Ratul Author • Edited

the cleanup function will be executed when any other new value will exist for the same variable and yeah it works.