1.3 react router

3.5h Today I did a lot of work getting react router to properly pass props down into the components. As soon as I got that figured out I realized I should probably be passing callback functions down instead(!), but it still needed to be learned. My initial confusion seems to be that the App function needs to have the state put into it in the jsx, then the function declaration needs to have it written in there, and then finally I need to write the switch statement differently for the elements that need props. It’s not a ‘component’ tag on the inside it is a ‘render’ one.

I also had a tough time mentally separating when I am writing jsx vs html vs js. I ended up making a string of some (correct) html that only output as string data when viewed in the browser. Through ample use of curly brackets I was able to sort it out. That actually helped me understand why I am seeing double curly brackets in other people’s code sometimes. The first one is to escape into jsx, and the second one escapes into javascript. I think this will be the type of thing that slows me down less the next time I run into it.

I’m all submitted for the week’s homework for Launch Academy. I’m looking forward to something new to chew on tomorrow. Today is day 217! Tomorrow should be fun.

Tell me what you think.

This site uses Akismet to reduce spam. Learn how your comment data is processed.