This is a solution to the IP address tracker challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects.
Users should be able to:
- View the optimal layout for each page depending on their device's screen size
- See hover states for all interactive elements on the page
- See their own IP address on the map on the initial page load
- Search for any IP addresses or domains and see the key information and location
- Live Site URL: ip-tracker.kimdanielkoch.de
- React - JS library
- Next.js - React framework
- Styled Components - For styles
- React Leaflet - Map Component
I decided to use Next.js and it's simple API implementation to request the external API to retrieve the location data without exposing my API key to the end user. Pages are pre-rendered in Next.js by default to improve performance and improve SEO. I had to disable this feature for th "Map" component because it depends on the window object. Because of this I got a "window is not defined" error. I learned that you can disable this by explicitly lazy loading the component with the "ssr:false" parameter
const MapNoSSR = dynamic(() => import("../components/Map/Map"), { ssr: false });- Website - kimdanielkoch.de
- Frontend Mentor - @Kimbo0o