GeoBorders - Google Maps, OpenStreetMaps, Typescript, Next.js

Solution retrospective
I was most excited by the chances to consume a real-life API. Fetching data - with a complex structure and rendering to the user, allowed me to exercise my skills in DOM Manipulation, conditional rendering, Array manipulation...
What challenges did you encounter, and how did you overcome them?I had an issue with theme switching. Theme switching being a client-side concept threw me into the rabbit hole of hydration. The system (on the server side) could not understand what window === undefined meant. The solution for this was to restrict theme change unless mounting is successful.
In the attempt to go beyond the expectations, I did realize that the location Marker
in React Leaflet https://react-leaflet.js.org/docs/ was not showing. A search on this pointed out that it is a common problem in Next.js. Trying to customize the marker only proved more stubborn as I quickly realized that I had set SSR (Browser-Only feature) to true - Had to disable it.
Rendering the Location Marker definitely - proved to be a headache.
Please log in to post a comment
Log in with GitHubCommunity feedback
No feedback yet. Be the first to give feedback on Stephen Mwangi'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