Closed luksrocha closed 3 years ago
try to use callback syntax
setCoords(prevState => ([...prevState, ${latitude} ${longitude}
]))
try to use callback syntax setCoords(prevState => ([...prevState,
${latitude} ${longitude}
]))
It worked for me!! thank you
I'm getting the coords and saving it into an array, but, even using spread operator I get only one item into it.
`
` and that is what I get
I need to save all of coords that I get in my Geolocation.watchPosition(), what should I do?