You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How can I make that if I change a state that stores the coordinates in a higher component and pass the state as a prop to the map component. How can I make that the center of the map changes if the state changes?
The text was updated successfully, but these errors were encountered:
Use useRef hook and create an instance reference of the map.
use useEffect hook to update the map position whenever lat or lng values changes as they are dependencies and use above code. I believe you can understand the code in useEffect hook. If not, reply to me, I'll explain
Add a reference in the MapContainer Component using ref tag and done.
How can I make that if I change a state that stores the coordinates in a higher component and pass the state as a prop to the map component. How can I make that the center of the map changes if the state changes?
The text was updated successfully, but these errors were encountered: