Skip to content

Is it possible to get user location only the first time the component is mounted? #883

Answered by KiwiKilian
Simplegram asked this question in Q&A
Discussion options

You must be logged in to vote

Did you try LocationManager.getLastKnownLocation() within a useEffect? I'm not sure, if this works without the UserLocation component beeing rendered, but it's worth a shot.

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
6 replies
@KiwiKilian
Comment options

@Simplegram
Comment options

@KiwiKilian
Comment options

@dilaksh06
Comment options

@Simplegram
Comment options

Answer selected by Simplegram
Comment options

tyrauber
Jun 21, 2025
Maintainer Sponsor

You must be logged in to vote
1 reply
@KiwiKilian
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants