Skip to content
Submitted about 1 year ago

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

next, react, tailwind-css, typescript, shadcn
LVL 2
@Stephen100Mwangi
A solution to the REST Countries API with color theme switcher challenge

Solution retrospective


What are you most proud of, and what would you do differently next time?

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.

What specific areas of your project would you like help with?

Rendering the Location Marker definitely - proved to be a headache.

Code
Loading...

Please log in to post a comment

Log in

Community 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