What if I add multiple dependency in React’s useEffect second parameter?
It will fire when either one changes. The way to think of it is that you are telling React: a and b are the things that I am using inside this effect, so if either of them change, my effect will need to cleanup the old version and re-execute with the updated values. Here’s a … Read more