No need to learn JavaScript, you can still write ReactJS

Tram Ho

Introduce

Now ReactJS is very popular and I see there are questions. What to learn to understand the basics of ReactJS? What do you need to know to learn ReactJS? The answer I often see is that if you want to understand the basics of ReactJS, you must learn JavaScript because JavaScriptis the root of ReactJS. ReactJS is written in JavaScript, so if you know JavaScript, you will understand the basics of ReactJS. Therefore, if you want to write well ReactJS, want to write ReactJS, first, learn JavaScript. So started learning JavaScript, learning the basic syntax, declaring variables, loops, es6, spread, lamda, async, await, blah blah. Phew, in the end you have a lot of knowledge about JavaScript, confidently write JavaScript to change the DOM, solve difficult logic but have it all but still don’t know how to write ReactJS. Don’t worry, ReactJS is based on JavaScript, knowing JavaScript is not afraid of stains. You start learning ReactJS, the first lesson, creating elements with React.

Second track, JSX

Lesson three, hook

At this point, I wonder, can I write these without Javascript? Writing React.createElement doesn’t need Javascript, writing JSX doesn’t need to know Javascript and knowing how to use useState doesn’t need Javascript. We just need to follow the rules of React. So do you need to learn Javascript to write React? To write ReactJS, you need to learn ReactJS, period.

But when learning ReactJS, still feel lacking, probably lack of Javascript. No, what you lack is knowledge, programming skills and skills around programming skills.

Programming knowledge and skills

To quickly and smoothly learn a new language or library or framework, you need to have strong programming knowledge.

The knowledge you need is the most basic things like variable declaration, conditional structure, loop, function, pointer, .. Next will be OOP such as class, interface, abstract, property, …

The concepts of async, sync, pass by reference, pass by value,… In terms of skills, you need to know about clean code, SOLID, DRY a little design pattern, divide layers, divide components, build website layouts,… .

Other skills

Patient

I put it at the top because this is probably the most important thing. When learning something new, we will find it a bit difficult to approach because the flow with its lifecycle doesn’t work as we usually do. But need to be patient, write a lot, read a lot to get used to, understand, feel the advantages and disadvantages of that approach and use it in the most appropriate way possible. And it is also inevitable that learning has errors, there are strange bugs that take hours to search, to learn to ask. The problem is still whether you have the patience to fix it or not. If you are not patient enough, you will think this tool is bullshit and quit. Just like that, you end up learning nothing.

English

English is very important because English is like a standard language. A certain well-known framework, language or library has an English docs. That’s why, you need English to be able to read the docs and keep up to date with the latest changes in frameworks, libraries or languages. English is still a pretty big barrier for programmers according to me. Learning English for work should focus on practice a lot to be able to listen and speak, chat and discuss with customers. No need to learn too much too complicated that cannot be applied in work.

Read the document

Usually any new language, library or framework has a document to guide and explain how it works and how to use it. It’s very important because it’s official and you can learn a lot of knowledge and experience from it without spending money on a course or needing someone to guide you. Take for example React Docs Beta, just with this Doc you can learn how to write a simple application using ReactJS. Knowing how to use JSX, hooks, custom hooks, writing tic tac toe, knowing how to divide components and layouts,…. After reading a lot, you will have experience and will have the skill to quickly and accurately find what you want. should be right there in that doc. Reading the doc also helps you better understand that technology.

Ask

There are new knowledge, I don’t think I understand. Searching for the question in the forum and on the net, there is no such thing. At this point, the fastest and best way is to ask those who have experience or have worked through that tech. Asking is also a skill because it has to be asked to the right point, can demonstrate to the person you ask what you have learned. Don’t ask through the speaker, ask without investment, sometimes the respondents will be uncomfortable or they will not understand the question and do not write what to answer.

Without learning Javascript, you can’t solve difficult and advanced problems in React

This is true, because ReactJS is essentially just Javascript. To really understand ReactJS, to solve difficult logic problems, sometimes it is necessary to have a deep understanding of Javascript. So learn Javascript before learning ReactJS, right? In my opinion, if you still want to learn ReactJS, then learn ReactJS, that’s it. The reason why. One is that when you are new to learning, you will not have such problems that you must have a deep understanding of Javascript to solve. Second, in order to meet those problems in ReactJS, you must know how to write ReactJS first, if you don’t know how to write ReactJS, where will you get the problem. At that time, if you need to solve a problem, it’s not too late to learn that topic in Javascript to solve that problem. Approaching this way will save you even more time. Instead of learning Javascript after learning ReactJS, I learned ReactJS, don’t understand anything, need to learn anything in Javascript, then learn the right topic and that’s it, no need to learn Javascript. Saves quite a bit of time.

Conclude

It is completely possible to write ReactJS without learning Javascript. Just learn ReactJS, create something, practice a lot. When there is a problem that requires Javascript, then it is not too late to learn. Don’t worry too much about how to solve performance, how to solve difficult logic, how to optimize the code in ReactJS. You have to actually write something in ReactJS before you have a problem to solve.

Share the news now

Source : Viblo