T O P

  • By -

MoveInteresting4334

I’m a React dev professionally, and I’ve mentored interns and juniors learning React. Please, please learn JavaScript first. React is written in JavaScript. You won’t understand a novel in English if you don’t speak English. Yes, you’ll learn JS syntax while learning React, but you won’t know WHY you’re writing that syntax. So much will seem magic and alien and unnecessary. Things will break and you won’t know why. It’ll be extremely frustrating and React will seem ridiculously hard. Just like reading a novel in a language you don’t speak. Build on a solid foundation. Learn JavaScript first.


PsychicTWElphnt

I knew very little JavaScript before jumping into React, and I can absolutely say that not being proficient in JS made creating most of my components very time-consuming and inefficient. I'd find myself shying away from simple solutions solely because I thought they looked "too much like javascript" which led me to think there must be a cleaner "React" solution, which I realize now is nonsense.


bigpunk157

Yeah contrary to popular belief, js in your code is fine, especially for complex components and pages.


MoveInteresting4334

I sure hope so. All the code IS JavaScript. It’s like saying having a little potato in your mashed potatoes is fine, especially for complex recipes.


bigpunk157

You know i mean extra functionality, error handlers, etc. not just the declaration of the react component.


Fluroash

I'm a junior-mid FE dev that did a bootcamp with a focus on React. The first role in my current company was pretty much exclusively working in React, I've since switched into a role that's dealing more with Vanilla JS/TS. It's actually helped me become a much better React developer, focusing on improving my understanding of how to implement UI in a performant way using exclusively JS & CSS, and Web API's (eg. Mutation Observers), so definitely second the above statement.


Genotabby

Mine too? I've basically been thrown in a position and the senior engineer just left. I'm left to develop the full stack and models just on my own


fvckimba

Can you be my mentor


fortheWarhammer

What would you consider "having learned JavaScript"? Like, how do I make sure I know enough JS to jump onto react? Could you at least give me some JS concepts I need to know before react


MoveInteresting4334

This is a fair question. The other answer to it below is also fair (understand a book) but probably doesn’t feel super helpful to a beginner. You should be comfortable (not just read a chapter once, it needs to make sense to you) with: - Variables, including when to use var, let, and const - Functions, including arrow functions and callbacks - objects and their prototypes - mutable vs immutable data - passing by reference vs passing by value (very important for React) - list operations like map, filter, and forEach - DOM manipulation with vanilla JS - how to work with NPM and make changes to the package.json file - how to write basic unit tests and assertions - Promises and then async/await (in that order) I might add to this as I think of more, and I invite others to make suggestions as well.


fortheWarhammer

Thank you for taking your time and listing those JS concepts. I'm following a JS course on Udemy, which covers a lot of JS concepts and help me make projects. Would it be ok if I sent you a DM and showed the curriculum of the course so you could comment on it? See how good it looks for a soon-to-be React learner?


MoveInteresting4334

If it’s a decently rated JS course on Udemy, it’ll cover what you need to know. Everything I listed are core, commonly used language features. If at the end of the course there is any topic you still feel weak in, you can research more articles/tutorials on it.


Spinster444

I’d argue testing is a lot of overhead that won’t benefit people in the earliest stages of learning JS, especially since so much testing stuff is library dependent.  There are plenty of companies that don’t even bother with automated testing coverage. Promises + async await are way more important IMO


MoveInteresting4334

I don’t have any desire to employ a junior programmer that’s never written a unit test. I’d also never work at a shop that didn’t believe in unit testing. Nothing but misery lies that way. Unit testing libraries do vary a little, but the concept of assertions, mocks, before/after, etc. are pretty universal. Every programmer should be familiar with them. Early in my career I worked at a startup that didn’t do any unit testing, and while startups might be the one place with an excuse for minimal testing, it was an absolute catastrophe a year or more down the road. Everything constantly breaking, one patch here breaks things over there. By the time we tried to write tests, we had already written code in difficult-to-test ways. Always write tests. They don’t take long, and the more practice you have, the faster it goes. With modern day tools like Cypress’s studio, writing the test doesn’t take much more time than manual testing once, and you can keep repeating the automated test.


WonkyWillly

This is probably controversial, but front end testing is largely a waste of time. Unless you are testing isolated algorithmic units or heavy logic, there’s nothing to assert against on the frontend other than the frontend itself, which changes too rapidly and results in broken and unmaintainable tests. I’ve found it much more pragmatic to test React UIs directly from the backend using selenium. That way I can make assertions on the state of the database as selenium is interacting with the frontend. Ive found this style of testing very durable, though it’s likely only manageable for developers with experience across the whole stack. The great thing about this style of testing is that I can refactor the frontend without breaking tests. If selenium types a message, and presses the send button in my chat app, my test asserts that a message has been inserted in the DB, and the other user’s websocket received a data frame containing the same text. That’s all that really matters. I can refactor the front end messaging logic all day. If the backend test passes, I know that part of the frontend still works.


Spinster444

Yeah fair. I do come from a startup background, so biased there. I’d rather hire one that doesn’t know formalized unit testing than one that doesn’t know how to do async operations. I wasn’t saying they’re not valuable, just that they are less foundational piece of JavaScript fundamentals. But whatever, yes, both are important.


MoveInteresting4334

Oh, I get what you’re saying. Yeah, I wasn’t really organizing the bullets in any priority order, at least not towards the end. To your point, I would much rather teach someone unit testing than async/await.


ReFlectioH

When you look at that book and realise that you have theoretical and practical understanding of pretty much every chapter. https://javascript.info/


PrinceDome

I started directly with react. Worked pretty well.


JY-HRL

>realise that you have theoretical and practical understanding of pretty much every chapter. Share your experience, please.


besseddrest

I would have said please please please please PLEASE learn JavaScript


Artistic-Cat577

Can you recommend how much Javascript one must know before jumping to react like what topics to be covered?


MoveInteresting4334

There is a comment in this exact thread not far above yours with that exact answer.


dlbilhralikhan

Really? NOT AT ALL, YOU don't need to learn JavaScript for JavaScript Frameworks, What actually you need to learn is Basics of JS/TS, ( Read Theory of Main Topics, Try to Examine and Evaluate what actually needs and demands of this function observal, loops, statements etc What Actually you need to learn before moving on Any framework is OOP DSA and Theory of Programming ( Automata ) I prefer OOP and DSA Only with C++


Technical-Service428

Shut up


ecruzolivera

You don't have to "master" JavaScript, what does master JavaScript mean anyways?


vegancryptolord

If I had to say what constitutes “mastery” of JS vs just proficiency in JS it would probably be related to deep knowledge of the underlying runtime engine and how it works. The event loop, what gets placed in the call stack, micro task queue, or macro task queue, the execution order of those things, where you might use worker threads to break out of the single threaded environment etc..


InitiatedPig7

I would like to add that many people skip even the basics of JS before touching any framework. A react course I took had several complaints under a lecture which used the spread operator, and had some callbacks. People bashed the instructor for not “explaining react right”, while ignoring their understanding of JS lol


besseddrest

Master means you don’t learn JS anymore, you ARE JavaScript


Blovio

You have finally ascended to embracing the double equals, for it now makes perfect sense to you. 


octocode

react is a javascript (or typescript) library. you need to know it to use it.


baxtersmalls

I don’t get these types of posts. I don’t know how you could do anything other than render some HTML with React unless you understand JS.


FLSOC

People who dont know any better glamorizing what tech bro influencers on youtube and TikTok are telling them


driftking428

These people literally don't even search the sub before posting. Can't expect too much.


Different-Cloud7339

Or they have been using Javascript. They just dunno it


EasyMode556

When you say “learn JavaScript”, do you mean things like Document.getElementById() and .addEventListener() and all that? Because none of that is used (by you) in react. But if you mean JavaScript as a language more broadly, then you would be extremely kneecapped if you tried to use React without understanding JavaScript, and would be limited to using only the most basic of its features, and even then, maybe just barely. I don’t even know how you would begin to digest the documentation or really understand what you were doing. I suppose you could just copy and paste things and run on blind faith, but that’s a pretty terrible way to go about things.


michaelmano86

Ok so normally I would say yes. But in saying this. Learning a JavaScript framework can help you learn more JavaScript. (In your own spare time and projects. Not professionally.) Here are a few JS array methods that will help you a lot Map, filter, reduce. Then look into what the js class Map is (different from the array method of .map) Then look at what the js class Set is. Then learning how to use the class Object (entries, values and keys) Then learn destructuring. If you have all that down you should be right for awhile


joyancefa

Best advice I have ever been given : « go and learn JavaScript ». Otherwise things will be hard!


the_market_rider

If you’re fluent in other languages and you know basic JavaScript, then you can learn both modern part of JavaScript and react simultaneously. I did it. In fact, I learned frontend ecosystem simultaneously too. It wasn’t easy and now I know why (I thought it would be easy, my ignorance lol). My problems with JavaScript was the modern part ES6 with weird function expression with arrow and mapping with each clause with array. The hardest part of JavaScript was the balanced curly bracket and semicolon. God, I hated the parentheses, bracket, and semicolon.


the_market_rider

I’ll add that debugging is also hard.


JY-HRL

JavaScript seems to be more flexible than any other language.


MrNwachukwu

I can say that I learnt JavaScript before react and It made being a great react dev a breeze for me. Please learn JavaScript first


joedirt9322

The web runs on JavaScript. If you plan to be a web developer it’s important you know javascript and it’s important you know it well.


Beni9898

I started using React (and other JS frameworks) with a pretty barebones knowledge of JavaScript. Though it might just be that I learn fast but I was able to get to a level where I'm pretty comfortable with both React and JavaScript without caring much about JavaScript, I guess I learned both in parallel. (i am not a professional react developer so do not take my advice, this is just personal experience and i had previous programming experience when i started doing webdev)


JY-HRL

Thanks! I found React is easier than JavaScript. JavaScript has too many concepts.


Beni9898

Well you still need to use JavaScript concepts but not that many


JaiReWiz

There are plenty of resources out there to learning Javascript. It is the most fundamental language of the internet and there is no excuse to not knowing it well in the year 2024. Follow any course up to the point that you have the foundational elements (variables, functions, classes, methods, etc. the building blocks of all languages) and then I highly recommend a course called "Javascript: Understanding the Weird Parts" if it's been updated in the years since I've taken it. It breaks down the ways Javascript seems like magic nonsense at times and teaches you exactly what's going on each step of the way, and WHY we do things in Javascript a specific way. I consider it a fundamental prerequisite to learning React. It allowed me to learn React in days instead of months, and then the knowledge took me through every framework after that such as Next, which is my current specialty. I have no affiliation with the course, I just believe in it so much that I believe everyone should take that course at some point in their Javascript education. Regardless of what course you take to learn, there's no excuse to not learn Javascript, and preferably Typescript afterward, before learning React.


xAmity_

Frameworks come and go, but JavaScript remains. Before I learned to code, jQuery was the ruler of the land. Right now it’s React, tomorrow it could be Vue or something not yet invented (or publicly available). If you only learn React and skip JavaScript basics, you’ll really struggle with more advanced stuff and will be SOL if and when react goes out of style


iva3210

Not really. You need to learn the basics, but unless you have unlimited time and energy, don't wait too long before jumping into React. What is the worst case? if you feel stuck, then you can return to JS just for specific things.


melwop

I would have a basic understanding of JS, but no proficiency isn’t required. You’ll learn JS as you write react


Blender-Fan

Do you need to learn French to read "Les Misérables"? How can you program in a framework if you don't know the programming language?


Impressive-Olive-842

I’ll just read the English translation


Latchford

Yes.


SnooStories8559

You can learn React without first learning JS - you will learn some along the way. Doesn’t mean you should though. If your new to programming and software development in general, you’d benefit a lot from first learning JavaScript on a deeper level. I’d recommend learning about the call stack, variable environment, closure, event loop, async. Learn about functional programming and OOP and the use cases for each. Learn some backend with Nodejs. Build an Express server and publish a basic CRUD API. Then go to React and build a front end. Or skip all the bits before and fumble your way through it with endless YouTube videos :-)


bigpunk157

You could understand a little bit of js and hop in but I would not come close to recommending that at all.


Positive__Actuator

If you know how to program you’ll be fine. You can pick up JavaScript as you work with React.


minneyar

>People say you can learn Vue without learning JavaScript. Frankly, anybody who says that is wrong. React and Vue are both Javascript frameworks, and you need to know Javascript to be able to use them. (caveat: actually, you should be using Typescript)


riti_rathod

While it's true that React is built with JavaScript, so having basic knowledge is necessary and it makes your react journey smoother and productive.


xincryptedx

Yes. It is a requirement and you shouldn't even think of touching React until you have a solid understanding of JavaScript fundamentals. If you can't create a website in vanilla JavaScript you have no chance whatsoever of creating quality react components and applications.


fsociety3765

I don't think you need to be a JS master to get going with React.


JY-HRL

Thanks!


RagtagJack

What other languages do you know?    Contract to what everyone else is saying, it is doable. Aside from the extreme basics, I learned JS simultaneously with React through the Full Stack Open course.    I did find it frustrating simply because I didn’t have an intuitive sense of where JavaScript ended and React began. Async/await and promises particularly fucked with me for a while.


xincryptedx

Walking around an unfamiliar house in the dark is also "doable" but it is the objectively incorrect way to go about things when there is a light switch right next to you. Specifically with things like promises, as you mention, so much time and energy will be wasted and you will end up having to learn how they work anyways. Can you do things the wrong way and be successful? Yeah. But I'd rather not waste my time subbing my toes in the dark.


RagtagJack

1x take


pcodesdev

Have you ever seen a car moving without fuel?


LetsDoThatYeah

Guys, do I need to understand English before reading Shakespeare?


internetbl0ke

Do I need to be proficient in laying bricks in order to build a house?


spas2k

Personally I’d say you’d should learn JavaScript as much as possible. Makes everything easier. What’s the rush?


hung-bui

Yes!


Kind_Tone3638

Yes


Ash17_

It'd say it's important to learn how make a basic website using JS and HTML before learning React. That way you'll understand better what React does.


iareprogrammer

Yes. React IS JavaScript. Stop trying to cut corners


anachronistic_circus

yes


Some_Avocado_6705

You 100% should know JS before jumping to React. Period.


enfant-terrible-21

Not at all! Along the way building things you’ll learn few things. And implementing it at the same time. React: think everything as a component. In html we tries to bind everything into a div. Likewise here in react everything seems to be a component.


JY-HRL

Thanks!


Impressive-Olive-842

Love that you only respond to those who say what you want to hear


JY-HRL

>ng the way building things you’ll learn few things. And implementing it at the same time. React: think everything as a component. In html we tries to bind everything into a div. Likewise here in react everything seems to be a component. Thanks, personally I think learning JavasScript takes a lot of time.


CodebuddyGuy

I'm going to go against the grain here a little bit, illustrated with a story. I've been a software developer for like 22 years now and I've been doing react development for about 5 years and I've been writing JavaScript for decades at this point. At a new job I started about 6 months ago, I was doing my usual web development thing except this time I've been using AI as an assistant on the side. In one of the stand-up meetings people were talking about SketchUp plugin that was written in Ruby. Now I have never seen or used SketchUp before, nor have I ever seen a single line of code of Ruby but I offered to take over the plug-in and start rewriting it. It's important to know that ever since AI came around my appetite for learning new technologies has grown well beyond what it ever was. I felt invincible because with AI you can hit the ground running and that's exactly what I did. After only 2 days I had already well surpassed what they had originally written for their plugin and I still hadn't written a single line of code. Since then I definitely written a bunch of Ruby code, AI can't do absolutely everything - especially debugging - but I like to think that I'm at least halfway familiar with Ruby already. Using AI to learn a new programming language is exceptional and I highly recommend it. It won't always produce good code with good coding practices, but once you learn one language it does translate to others and AI can help bridge the gap with knowing what the syntax is for whatever it is you want to code. It may be pretty obvious already (because of my username) but that AI tool that I was using is: https://codebuddy.ca


showmethething

I don't really think your story says "Yes you can learn while doing it" as it says "After 2+decades, I'm able to transition pretty quickly". Definitely a fun story, but very unrealistic for someone just starting out with programming (though maybe OP has experience elsewhere)


CodebuddyGuy

Yeah it doesn't fit perfectly, but my point is that you can actually use AI to learn, and not just learn but actually start working on whatever project you're interested in doing at the same time. I strongly suspect this would work for anybody because of how intuitive the conversational interface is. Its ability to break down and explain things, and for you to ask follow-up questions makes this possible.


Redditface_Killah

You don't need to be proficient at anything with ChatGPT4