DEV Community

Cover image for A Couple of Sweet Victories Yesterday
Alex Morton
Alex Morton

Posted on

A Couple of Sweet Victories Yesterday

This post was originally published on October 14, 2020 on my blog.

Yesterday was one of those days where you just feel like all of your learning struggles finally reach the top of the mountain and you start to see the beautiful view.

I love those moments when everything comes together and the answers to hard problems I've been steadily chipping away at start to reveal themselves.

Yesterday, I had a couple of those - which definitely felt amazing! The first was that I was able to successfully automate inputting a huge majority of my city guide data for my So You Think You Can France project with a very simple Node program. It was one of those things where you find a good-looking solution online, but you're a little nervous to try it out.

Well try it out I did, and I seriously felt like a magician each time I ran the program that input the data within literal seconds - ah, amazing.

Secondly, I finally figured out a tough newbie mistake regarding React and the props passed down to a certain component - and it actually allowed me to refactor that component down to 32 lines of code (from a whopping 175 lines!!!!).

Essentially, my problem was that I was passing down a different object as props than what I needed the component to handle, so my solution was to pass down the object property (i.e. city.travelIdeas as an array instead of just city as an object and then trying to access the travelIdeas property from the component itself).

Oh, sweet victory. I'm looking forward to adding my previously-written blog posts to my So You Think You Can France project in the coming days. It's really all coming together.

Anyway, today is Podcast Production Day for me, so I'm going to be steadily moving down the list of what needs to be done for that!

P.S. Did you know I have a podcast with new episodes each Wednesday? Go listen right over here >>

The Ladies Code Collective Podcast cover art

Top comments (0)