loading...

#ChadWritesCode End of Period Log Oct 12 - 25 2020: React Context

chad_r_stewart profile image Chad R. Stewart ・3 min read

So for those following along, you might be wondering what happened to last weeks update? Well I had a bit of uncertainty in my life at the time that affected my plans moving forward. Was half expecting to be knee-deep in interview prep but things didn't turn out that way and I'm just really bad at getting back on track after that. This past week I honestly didn't do too much but I felt I should acknowledge it here. Either way, I still wanted to write my log so onto the show!

So first of all, let me talk about the re-learning those algorithms. Like I said, thought I would be starting interview prep and so I decided that getting a head start would be a good idea. I did a little bit of work in this area but I wouldn't say I re-learned these algorithms. The intention was to be able to write them from memory on a whim if I needed to and that just didn't happen. Just felt I should mention that before moving forward.

What I did accomplish was going through the React Scrimba course and covering the topic of Context in React. So in terms of state management in React, I learned to use Redux and I remember a friend implementing Redux in her own project. She ended up writing an article about her experience and how Redux may be overkill for a small project like the one she was working on. After going through this section of the course, I kinda wish I was able to suggest to her to just React's Context API (though to be fair, there's probably a reason why she wanted to use Redux outside of needing state management).

So full disclosure, I don't understand Redux enough to know when need to use it over Context by itself but I definitely like that the same patterns that you use with Redux you can use with Context. As I messed around with it in the tutorial, it felt significantly easier to implement, understand and maintain than Redux. In fact, when I was working, that was something I constantly had a problem with. We had implemented Redux in the React project we had and I always had a hard time making changes to Redux. Looking back at it, honestly we really just had a really large store more than anything else and any of the major complexity really came from the Reducers. I'd have to look at the code again (which I don't have access to) but I'm pretty sure we could achieve the same result without Redux. I also feel it would be easier to maintain but I wonder if that's me being subjective or not.

Regardless, React Context is a welcome addition to my toolkit and makes exploring Redux or other state management tools more interesting cause know I'll have a better idea on how to judge other tools and whether they will provide value to a project I work on. Always a good thing!!

So in the week coming up I'll work on React Hooks, the real meat and potatoes of the course. Until then, see you next time!

Discussion

pic
Editor guide