Why you should study Javascript before diving into ReactJS

sahilthakur7

Sahil Thakur

Posted on August 23, 2020

Why you should study Javascript before diving into ReactJS

The original article is written here on my blog ->
https://easyontheweb.com/why-you-should-study-javascript-before-you-get-into-react/

There’s a lot of people who have asked me this question before and therefore I thought of writing an article on this today on a clear Sunday afternoon – Why you should study Javascript before you get into React.

This article will be written keeping in my mind people who have yet to dive into React and are thinking of doing so, or have already started with React and are facing some issues with it.

Other than the number of people asking this same thing, another reason for me to write this article is probably the point I mentioned before. I was one of the people who dived directly into React and struggled with it initially before giving it a rest and going back to Javascript and then returning again. So, been there , done that.

For people who haven’t started yet
In this section I’ll give some tips I think will be helpful to people who still haven’t started with React yet and are planning to do so. Also, if you aren’t planning to do so – Please do. React is absolutely awesome and I think you should probably give it a try.

In the older days of web development, actually not even that old, but say 10 years before today – not many people took Javascript as a serious language. It was thought of as only something used to add effects on a webpage or manipulate your DOM some way. There were not very many applications of the language itself.

Fast forward 10 years, Javascript is probably the most popular language in the world along with Python at this moment of time. What happened? Well, two things happened actually :-

The whole landscape around frontend development changed as people’s browsers and machines became more powerful. Powerful enough to compute things and execute things on the client side. This gave rise to frameworks and libraries like Angular, React , Vue etc etc.
NodeJS – Along came node and something happened that no one could have guessed , backends started being written in Javascript. You only needed one language for your entire development process. Cool, eh ?
Today, as mentioned before, Javascript is probably the most popular language in the world and is taken very seriously now. That is why, if you want to start with web development, not just React – I think you should grasp the fundamentals of Javascript.

Javascript is no longer just the language to animate your webpage or make simple DOM manipulations, everything happens in Javascript now – your entire web application building.

Why I think you should have a complete and thorough grasp of Javascript ? Because if you have that, tomorrow it won’t be a problem for you to work on Vue or Angular or any other JS framework. Sure, there are some differences to each of them but the underlying basics and fundamentals of the language are same.

How much Javascript should you learn before diving into React ? That is something we’ll cover in an upcoming section. But I hope you do understand that it is vital to learn Javascript before getting into React if you haven’t yet started.

For people who have started and are struggling
For everyone in this category, cheers – because this was me some years back. I was a Ruby on Rails developer in college and I thought of learning this hot new library in the market called ReactJS and I thought I knew Javascript – I could console log stuff, I could manipulate the DOM, I could code in Javascript . Or so I thought.

Just manipulating the DOM isn’t Javascript , that is what I came to know once I started learning React because I really struggled big time. I had no thorough knowledge of Javascript concepts and to be honest didn’t even know much outside Ruby and C at that point of time. But as I began struggling, I got to know there was a lot in Javascript yet to be discovered by me (and still is).

What I did right was that after some initial struggle I put learning React on a hold and instead went back and started studying Javascript seriously – something which has come very very handy in my life now. I started respecting Javascript and luckily for me ES2015 was coming around at that time so I loved the language, the syntax and everything around it.

When I finally felt confident enough to dive back into React, I did. Not that I had learned all the concepts of the language, because I still haven’t . But I just fell confident in myself and my JS knowledge. I knew that I wouldn’t struggle with React anymore. Luckily, I did not – in places that I did, I would take a little break and learn the JS concept behind it again.

In fact, it’s totally fine even if you struggle the second time out as well – just study the same concept again. In programming, practice makes perfect. There is no other way around it.

What is important is to be confident enough in your JS skills, you’ll know when you reach there. You’ll start understanding what is happening in React because at the end of the day React is nothing but a library written in Javascript , is it not?

How much Javascript is enough ?
Our discussion begs the question now – just how much Javascript is actually needed before you can dive into React. The vague answer would be the one I gave in the last section – “When you feel confident about it”. To be honest, that really is the actual answer to this question but I know no one reading this article actually wants to hear it. I never want to hear such answers when I’m reading a blogpost myself.

I’ll just go ahead and name few topics which I feel are the most important ones for you to know about :-

How the DOM works.
Asynchronous Javascript
Object oriented nature of Javascript
Single Threaded nature
Import and module concepts
I think if you get these concepts of Javascript in your grip, you won’t face much problems when it comes to working with React. Anyways, whenever you work on anything – you learn everyday, about the language , about the patterns , about various different things. So don’t stress on just trying to learn everything at one go.

I just want you to learn enough so that you don’t get overwhelmed when it comes to working with React like I did and that is the purpose of this article.

Some resources I used
I have created a list of resources I used to learn Javascript as well as React and I think you would benefit greatly when it comes to good resources if you take a look at these -> https://easyontheweb.com/reactjs-resources-for-beginners-from-scratch/

Also, if you’re on facebook and would like to get regular updates of all the articles that are put up on the blog – Please join this facebook group for the blog -> https://www.facebook.com/groups/503230450489995/

💖 💪 🙅 🚩
sahilthakur7
Sahil Thakur

Posted on August 23, 2020

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related