Home twitter


May 12, 2020

I recursed through the State and Lifecycle article in the React docs, as I figured out how yo fork code snippets on Codepen. I rebuilt the clock app in pure JS. Having done that, I continued on to learning about Handling Events with React, where I got tripped up on the binding of 'this'. I was confused as to why a method needed to be bound in the "onClick" example and not the "clock" example. After some review, I realized that the "onClick" example used a function to update the UI, whereas the "clock" example automatically updated the state. So much to learn.

Having an idea of how I want my blog to function, I've jumped over to getting MongoDB set up with a collection to store my blog posts. As part of the process, I learned how to enable access control and set up users. The idea is that I can start writing and inserting blog posts so I have content to pull from as I make my way through learning React. Due to a fucking missing comma, it took me a few tries to execute the JavaScript file that would both create the collection I will use for my blog posts, as well as establish the validation schema, but I figured it out and got it done. After that, inserting the document was simple enough. I'm getting closer to dealing with authentication all over again, but hopefully by then, I'll have enough knowledge and practice to be far more successful. Also, in working through some of the Mongo docs, I came across resources pertaining to Oauth2 authentication. I saved those to return to when it comes time to revisit authentication.