If you try to learn React, Vue, or Angular as a beginner, the first piece of advice you get is to go learn JavaScript - anyone without some JavaScript experience is going to struggle with the added learning curve presented by a framework.
What isn't discussed is how much JavaScript to learn - Do you stop at the basics, or do you need total mastery before you write you finally open your first React tutorial? When are you actually ready to start using a framework?
Concepts you should know
I'm going to level with you: you don't need that much JavaScript to get started with a framework. As long as you have a decent understanding of the building blocks, you're good to go.
This is the list of things you need to have a solid understanding of:
- Variables and Functions
- Objects and Arrays
- Control Flow –
if
/else
,while
,for
Believe it or not, that's the complete list - but this is just to get started - but don't think your JavaScript journey is over yet.
Concepts you should be ready to encounter
Aside from the must know concepts, it pays to have an awareness of broader concepts - These are concepts you won't need to follow the early tutorials, but will need before you'll be able to write full applications.
- HTML/CSS
- Scopes (how
var
,let
, andconst
work; closures) - Object Oriented JavaScript (
class
) - Functional JavaScript (
filter
,map
,reduce
) -
import
/export
- How
this
works; contexts -
async
functions, and AJAX.
If you start with frameworks before having an understanding of these concepts, you should expect to need to stop and revisit pieces of this list throughout your learning journey. However, remember that frameworks are an excellent learning space for learning advanced concepts, since they leverage them constantly.
If there is anything on the above list you don't understand yet, you can still start your framework journey - as you understand different parts more, ideas you once struggled can become a lot easier.
Learn to build things
In my opinion, the most important step you should take before you learn a framework is to learn how to build things.
Building things with programming is an acquired skill, and developing the ability to successfully break down tasks so they can be translated into code is a vital skill in any programming language.
The most important part here is that you build very small things - far smaller than you might think, such as "a button that plays your favourite song", "a form that lets the user add and remove fields", or "a box that chases the users mouse around the page". You can check out this article if you're struggling with ideas.
Building things is harder than you'd think and maintaining motivation is difficult, so you want to choose small, achievable projects that you'll finish. A good test to see if the project is small enough is if you think you can do in under an hour. If it takes longer, no big deal - it's likely not going to take significantly longer.
When you've built a couple of these simple things, then you can introduce a framework. You should keep building simple things with your framework until you're comfortable again before finally moving to more ambitious projects, if you choose - or you can use your new portfolio of projects to land your first job!
Advice for switching
If there's one piece of advice I have for people trying to learn any programming language, it's that you will get stuck - All. the. time. This is going to be doubly true once you pick up a framework, since you're going to encounter a lot of unfamiliar concepts all at once.
If you're overwhelmed, the best thing you can do is to focus only on the task at hand. You don't need to spend an hour reading up how class
and import
work just yet if all you're trying to do is get "Hello World" on the page.
Take things slowly, build on your previous knowledge - it's not a race.
Top comments (10)
I've always wondered this myself, and yea, I don't think I've seen someone actually say how much js is enough.
This was a good read. I just started messing with React and I know a little about most of this js list (to my own surprise!), so maybe I'm not jumping the gun as much as I was thinking.
I’m working as an iOS developer (Swift, Objc), so I would say I’m not a totally newbie in programming. But some days ago I started to think about that maybe I should learn react native. I have a very basic html/css knowledge, but no JS.
My question is, what do you think, how much pure JS should I learn before dive into react native, I mean of course I know what basic things like functions, loops, lambdas (closures) are, so I don’t want to waste so much time on these, I would like to start using react native as fast as possible.
Normally, I'd suggest that you do some building with React before going into React Native, but since you already come from the mobile world, it may be easier for you to pick up React Native almost immediately - that way you'll encounter concepts you're familiar with immediately instead of having to learn Web Development just so you can practice.
Since you're already familiar with programming, rush through a JS course to learn the syntax (particularly the stuff introduced in ES6), keep a tab open to look up the parts you forget and then dive straight into React Native. The only thing I would recommend is that you keep your React Native configurations as out-of-the-box as possible while you're learning so you don't go down a weird rabbit hole trying to configure Webpack etc.
Expect to spend a little time bouncing around between the React and React Native docs as you get a grasp of the concepts, though. React can be a weird way of thinking if you're not used to it - I've found the writings of Dave Ceddia to be really helpful with React.
Thank you for your fast and informative response!
I started learning frameworks when I got annoyed with document.addEventListener() for everything I wanted people to interact with.
It's so much nicer to do an onClick event handler in something like library.
These are great tips. Interestingly I am writing my blog post ever in this same topic, but more tailored to React.Most of the JavaScript you suggested here are on my list , plus a few more.
You just answered a question I had in my mind lately. Specially after attending the Vue Day at Alicante, Spain last week.
Hey! Glad I could be of help :)
My answer to that title is... when you get into a new project and the client due to licensing reasons asks the team to use 'X' framework hahaha. Gotta get some training in order to catch up.
Thank you for these. I am getting so many inputs regarding Vue and React lately, that I s que confused about when would I have enough base to Start with any of them.