IP Adress Tracker With React

Solution retrospective
There is a few points I want to share. In order to get the map updated after doing another search, I did some research and found a way with "useReducer", which I would call inside the function that handles the IP search. With that in mind, I would like to know if there is another (recommended/better) way to get that map updated, since the card component already does it without any dedicated function... (that is also something I found weird, the fact that the component will rerender but the map will not). Also, how I managed to verify which type of prop I should set for the leaflet API url... I did a silly switch case verification transforming the first char of the input value in a number and checking if its type would match. If it sounds confusing, you can check the code to make ir clearer. Anywho, I would love to get suggestions in which way I could go in order to check if the input value is an IP adress or an online domain.
tl;dr: you need to disable any ad blocker or anti-tracker in order to make the solution work :)
Please log in to post a comment
Log in with GitHubCommunity feedback
No feedback yet. Be the first to give feedback on Lisandra Ferraz's solution.
Join 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