r/reactjs • • Sep 03 '20

[deleted by user]

[removed]

22 Upvotes

255 comments sorted by

View all comments

Show parent comment

1

u/Awnry_Abe Sep 21 '20

Post some code so we can help. If your effect is dependent on both long and lat as individual variables like this: }, [long, lat]);

and each has its own useState(), you'll get one execution for each setter.