On learning React
October 8, 2020
LEARNING: the acquisition of knowledge or skills through study, experience, or being taught.
Hello there 👋! It's no secret that I am a big fan of Vue.js and I really love the framework because of it's simplicity and developer love. I have been very much active in the Vue community, writing and maintain open-source Vue plugins, writing articles and even started Nuxt.js Africa in a bid to spread the word about the framework and foster more adoption in Africa(I haven't been really active in this though).
I literally got my first professional software engineering role back in 2018 as a front-end engineer using the Vue framework so you can see clearly I have been Vue for quite a while, so why learn React?
Earlier thoughts about React
I didn't have a lot of acceptance for the React framework for quite a while, I found it cumbersome to learn and the entire thing with JSX was a total show stopper for me. I have literally refused to touch React over the years.
Now you might be thinking "Kelvin, what got you to change your mind then?". What else is responsible for the gross percentage of change my friend - NECESSITY
NECESSITY - the state or fact of being required.
Let me explain what I meant by me learning React being a necessity. I have previously turned down consulting gigs because the client wanted me to use React, which I balked at(the younger me was very emotional about my front-end stack). But a while ago I had to write an article and needed to make the demo in React - my first thought was "Hell no!", but thinking about it; I like the tech I was supposed to write about so why let me not liking React hinder me from writing the article? So I decided to eat the frog and ran
npx create-react-app demo, and what happened next was shocking to me...
I liked what I saw, I mean, I have seen a React codebase back then in 2018 and I hated it, the binding to
this and the class base component it was just not for me. But what I saw in the
demo app boilerplate was friendly. I saw a simple component without
this it was a functional component and it made use of the trending React Hooks. For once I understood what was going on in a React codebase and the JSX syntax, wasn't really that confusing anymore!
Also when it came to testing the components, I subscribed immediately to the principle of React Testing Library. It made a whole lot of sense to me to test my component from the prospective of the user and not from my perspective as the developer. It was genius!
Noticing this, I started to feel a bit guilty for liking what I saw because I was(and still am) a Vue believer. I was able to attain closure by analyzing myself and here is what I deduced...
My learning strategy
Though I feel hyped about my journey to learn React, I wouldn't want to abandon Vue and since Vue 3 just launched, it will be exciting to learn React and Vue 3 along side. I spent most times these days watching React conference talks like this to imbibe the React philosophy
I always believe understanding the intention of a creator would allow you better understand and utilize a piece of software of programming language.
P.S: I am still a Vue guy, I'm just augment my tool set my learning React as well
So that's it! I will be sharing what I find in using React to build Sailscasts(privately first to my email list so go subscribe!) and a bit of the journey might be shared here on this blog as well.
As always, you can tweet at me on Twitter your thoughts on this article.
Code expressively 🎨,