useeffect is run on each rerender to prevent that i pass an empty array
React.useEffect(()=>{},[])
And to fire useeffect on state change of let's say count state variable
React.useEffect(()=>{},[count])
And if i have more of one state variable
React.useEffect(()=>{},[count, somethingelse])
My question is how to know which state variable caused the firing on useeffect hook
EDIT:
For people who are still checking this You can just do the following you can have multiple useEffect function
React.useEffect(()=>{},[count])
this will fire when count will change
React.useEffect(()=>{},[somethingelse])
this will fire when somethingelse will change