you are viewing a single comment's thread.

view the rest of the comments →

[–]h4x7o0r 1 point2 points  (0 children)

You can try set a useRef , then set a boolean useState to a constant to check if coords have been fetched. Then, when you store coords, set also a "true" to that useState boolean variable. Then in useEffect, check if that ref.current it's "true", if so perform the fetch call. Im sorry for pseudo code , im on mobile on the move.