Design comparison
SolutionDesign
Community feedback
- @AdelinkedPosted about 2 years ago
Hi nkp111, I really like your solution but i noticed that when we update the IP address and have a new location it's not updated on the map. There a useMap hook from react-leaflet that you can use to update the center of the map for exemple like this:
import { useMap } from "react-leaflet"; export default function ChangeView({ center, zoom }) { const map = useMap(); map.setView(center, zoom); return null; }
Marked as helpful0@nkp1111Posted about 2 years ago@Adelinked Thank you for your help. I was looking to do the same.
1
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord