Phase 2 Flatiron
Tags: react, softwareengineering
Published: 2023-10-20 12:20:58

Hello to anyone reading this, phase 2 at Flatiron School has ended and I wanted to talk about it to begin with there's the fact that, unlike the last phase, I wasn’t completely lost when learning React because I was able to take the concepts from the last phase and apply them here. To begin with, GET requests didn’t change much but the fact that I needed the use effect function for them stumped me a bit because of the new syntax I needed to type like when I was studying for the code challenge and completing the labs I kept forgetting the brackets after the arrow and even then I would forget the comma square brackets that I needed at the end so that the script didn’t constantly make GET requests now that we are nearing the end of phase 2 though I'm starting to remember those things a lot better. Another thing that did stump me for a bit was the components and remembering when to import and what props needed to be passed down to other components it helped that it was pretty similar to Unity C# except that instead of props being passed down in Unity you get access to the whole script by using variable.name, name being the thing you wanted to access whether that was a function or just a single variable and there were ways to just access one thing but that depends on what you were trying to do. This is also where my big streak of typos started, props would have completely different names or just be one letter off, or when passing them down in the next component I would forget to have curly brackets around the props and get errors because of this, the URL needed to fetch would have the same issue. Because of this, I started making a URL variable called URL at the top level and passing it down as a prop wherever I needed it and just typing URL in the parentheses of fetch methods to avoid typos because it's only three letters. When it finally came to our code challenge and after trying to memorize everything I still kept forgetting a lot, especially in my initial GET request and my POST request, in my GET request I forgot the parentheses and arrow after using use Effect and I also initially forgot the structure of use Effect since I forgot where to put the comma and square brackets and even after all that because I didn't read carefully when creating a search filter for the project I was trying to match it with a key called name in db.json, except name didn't exist and I ended up spending a good chunk of my time on it trying to figure out what could possibly be wrong. Finally, the reason I didn't pass the code challenge that day was that I forgot to use the spread operator to make a copy of my form template that would then be passed to db.json even though I had already used it before in my account container component to add the new object to the list whenever it was posted so that the user didn't have to refresh to see what they added and because of this error whenever the user submitted instead of making a copy of the template and posting that to the db.json it would replace the template with the last thing the user typed before they hit submit which also caused other errors because when the page tried to get the rest of the nonexistent keys the whole site would break and I would have to delete it in the file first. Overall this phase has been very fun even if I did fail the code challenge at first I was still able to pass the Monday after by figuring out what I did wrong and explaining how it worked to make sure I actually knew what I was doing.