Causing an infinite loop in react
I am learning react and i want to know how the following code leads to infinite loop and how to avoid this issue. Note: navigator.geolocation.getCurrentPosition((position) is imported from different js file
My code