I'm sure I have got the wrong understanding on this. I have the following component
const Comp = () => {
const filter = 'a';
useEffect(() => {
console.log('executing effect');
loadFriends();
}, [filter]);
return (
<Div>
{friendsFilter}
</Div>
);
};
Now as per my understanding, since the dependency list on useEffect
is filter
react should not run the effect when the component gets rendered again ? However it seems to run it. Am I understanding something wrong here?