Do You Need To Master JavaScript Before Learning React?

January 16, 2022 - 3 minutes

One of the main concerns that I see at different platforms from developers learning React is the relationship between JavaScript knowledge and React. Most of them know that React is a JavaScript library and thus that they should have a certain level of knowledge about JavaScript. But they’re often uncertain about how much they should dive into JavaScript before turning towards React.

As someone who started learning React on his own more than 4 years ago and has been working as a React developer for the past 3 years, it’s a concern that I’m extremely familiar with. It’s a struggle that I had as well in the beginning. Although it worked out in the end, it definitely could’ve been a smoother process. Using that experience, this article will cover whether you should master JavaScript before learning React and how far you should take it.

The main concern that newcomers often have is that their mastery of JavaScript is limited and therefore they aren’t able to properly learn React.

It is certain that having prior knowledge and a proper understanding of JavaScript will help you pick up React quicker. Ultimately, React is just a UI library built on top of HTML/CSS/JavaScript, where JS is responsible for most of the logic. Knowing about concepts like variables, array functions, callbacks, scopes, closures, and other JS related topics will definitely benefit you. It will tremendously speed up the pace at which you’re able to study and learn React.

But, does that mean that you’re not able to study React without knowing those concepts?

I would say it’s definitely recommended to familiarise yourself with them. It will make your learning process considerably easier, but it’s by no means a necessity. If your goal is to pick up React, don’t wait with it until you think you’ve mastered all of JavaScript. Based on personal experience, it’s likely that that moment won’t happen. In the end, the only thing you will have achieved is learning JavaScript instead of React.

There are a lot of resources out there that will give you pointers towards the recommended JavaScript concepts and functions to learn before React. Take a look and familiarise yourself with them, but don’t spend years on it. Knowing that they exist should be enough for most of the cases. After that, start learning React.

Yes, there will be JavaScript topics that you don’t understand, but that’s fine. Since you already familiarised yourself with the most common JavaScript topics, you should be able to go through React without stopping for every JavaScript topic. You can look up the topics that you don’t understand and then learn about them on the fly. Doing it while learning React guarantees you that it’s relevant and increases the chances of it sticking.

But, should I learn everything about JavaScript then?

Not really. While knowing certain JavaScript concepts is beneficial, not every concept in JavaScript is also used in React. For example, I would say that it’s perfectly fine to not know about the details of this (if you’re not using class components) or how the prototype chain works. While they are crucial for proper JavaScript development, some topics will not be relevant on a day-to-day basis as a React developer.

Final Thoughts

People often try to over-prepare themselves. The same applies to learning new technologies, frameworks, or libraries. I’ve seen a lot of developers also do this with React, myself included when I started my journey into frontend development. Looking back at it, this article uses that experience to answer some of the biggest concerns about the relationship between JavaScript and learning React for newcomers.

React is a JavaScript-based UI library, there is no way around it. If you want to write React code, you’ll also have to write JavaScript code. Therefore, it’s recommended to learn a bit about JavaScript. But don’t overdo it. Create a foundation and move on to React. In the worse case, you can learn things on the fly. Ultimately, your goal is to learn React, not JavaScript.

After graduation, my career is entirely centered around learning and improving as a developer. I’ve began working full time as a React developer and I’ll be blogging about everything that I encounter and learn during this journey. This will range from improving communicational skills in a technical environment, becoming a better developer, improving technical skills in React and JavaScript, and discussing career related topics. In all of my posts, the focus will be on my personal experiences, learnings, difficulties, solutions (if present), and also flaws.

If you’re either interested in these topics, more personalised technical stories, or the perspective of a learning developer, you can follow me either on Twitter or at Dev to stay up to date with my blogposts. I’m always learning, so stay tuned for more stories! 🎉