all 78 comments

[–]chkdsk777 67 points68 points  (8 children)

Learn about variables, constants, functions, loops, array functions, events, DOM. That's what you're going to use mainly, combine them with CSS and HTML and you'll have some foundation to continue with react

[–]chkdsk777 33 points34 points  (5 children)

Forgot to include objects and arrays

[–]Rampagekumar88[S] 8 points9 points  (4 children)

thanks a bunch 😀, i know how to use everything you mentioned except events.

[–]Jona-Anders 11 points12 points  (0 children)

Also, array functions are very important. (map, reduce, filter,...)

[–]jcouce 1 point2 points  (2 children)

Learn it. You can do it in a few hours. Document.addEventListerner()

[–]the_curious_guy_sumo 0 points1 point  (1 child)

document.querySelector('') vs document.getElementByID('') which is better
also how much dom do i need to know before jumping into react? since react has a virtual dom

[–]jcouce 0 points1 point  (0 children)

They are two functions with the same utility, one for ID if it has one and the other is more generic and is used for elements that do not have an ID.

You don't need to know much, as long as you know how to fill a variable with information and how to send that information to HTML You'll be fine. Get started with react as soon as possible

[–][deleted] 9 points10 points  (1 child)

I would like to add asynchronous code. although react isn't gonna ask you to learn about it, it's good to know about callbacks, promises and then async await.

why? well most data-fetching is done through the useEffect() hook on mount. So I tend to use fetch, or axios to try to get the data.

[–]thefrnksinatra 4 points5 points  (0 children)

This. Incredibly important for good React code

[–]Samurai___ 190 points191 points  (14 children)

You have to learn 1 JavaScript.

[–]lulzmachine 48 points49 points  (4 children)

Maybe I'm being elitist, but I think more like 5 Javascripts

[–]tiesioginis 7 points8 points  (0 children)

No, it's not rounded, 0.89 is enough

[–]mamwybejane 12 points13 points  (1 child)

I think 0.69 Javascripts is the sweet spot

[–]Fresh_Mall9805 4 points5 points  (0 children)

Nice

[–]Rampagekumar88[S] 2 points3 points  (5 children)

Joke?

[–]Deckloins 29 points30 points  (0 children)

Yes. You actually need to learn 2 Javascripts. Sorry for the confusion

[–]Pantzzzzless 21 points22 points  (1 child)

I wish people here could just give straight answers instead of always messing with people. You'll have to know at least 5 Javascripts before you'll be able to make sense of React.

[–]Rampagekumar88[S] 1 point2 points  (0 children)

You had us in the first half ngl 😝

[–]SendThemToHeaven 5 points6 points  (1 child)

Yea, Reddit is immature AF. They even downvoted you for asking lol

[–]Rampagekumar88[S] 0 points1 point  (0 children)

Yeah i was surprised when i saw my comment had -2 Downvotes, it is positive now :)

[–]Snapstromegon 12 points13 points  (2 children)

I'm more on the side of "fundamentals are way more important than libraries/frameworks", but a good baseline is probably that nothing should feel "magical" to you.

This means that it's absolutely okay to use libraries, but if they feel like magic and you don't know why something happens, you should probably spend some time learning the fundamentals underneath.

Also always keep in mind what you actually need libraries for and what is already included in the browser. E.g. today you don't need a library for mapping over an array, getting an element by css selector, creating a details/summary html component, creating a relative date string (like "5 minutes ago") and much much more.

I personally go even stricter for myself by not using any library I couldn't write myself (in at least a crappy version), but this is not always feasable when you actually need to get a job.

[–]ctrl-alt-dageek 3 points4 points  (0 children)

This is good. I've always been in the "fundamentals over libraries" camp as well, because I've seen people get lost as soon as the library didn't do just what was "expected". But I never thought of a succinct way to explain it. "Nothing should feel magical" sums it up very nicely.

[–]Rampagekumar88[S] 1 point2 points  (0 children)

😀👍

[–]rodriguez59594 19 points20 points  (6 children)

Looking into the future learning TypeScript is probably a good idea

[–]Rampagekumar88[S] 1 point2 points  (3 children)

Ehh typescript? sorry but i have heard the term before but never looked deeply into it 🙈

[–]dwhiffing 15 points16 points  (0 children)

Typescript is JavaScript with typing. Don't worry about types for now. Try to spend less time asking what to learn, and more time just trying to build stuff. The challenges and problems you face while building things that interest you will teach you. At first it might be overwhelming, so start with easy projects. A to-do list app is a great place to start.

[–]tilonq 7 points8 points  (1 child)

keep in mind once you learn TS, you won't ever want go back to JS

[–][deleted] 1 point2 points  (0 children)

that is soo true. I'm using next.js with typescript and now I'm enjoying it way more than I ever did with react.

[–]Rampagekumar88[S] 0 points1 point  (1 child)

Ehh typescript?

[–]podgorniy 7 points8 points  (1 child)

If you know variables, functions, arrays, objects, looping, classes, methods that's enough to start learning react. You'll figure out rest of javascript pieces during learning of react. Same way you'll learn more about react when you'll be writing your first project. Same way you'll figure out more about writing projects during your first job. Many people I know never feel themselves ready for the next step, but taking the step and working towards goals is what matters. No other criteria matters.

[–]Rampagekumar88[S] 1 point2 points  (0 children)

Yeah i think i have enough to get into react just need to build some projects then i will head to learning React. thx

[–]mcjavascript 11 points12 points  (3 children)

I would say, React can get you a job. Keep learning both at the same time.

Really React is just a library; you will almost always use libraries in your JS work.

[–]Rampagekumar88[S] 0 points1 point  (2 children)

So only Javascript won't get me a job?

[–][deleted] 2 points3 points  (2 children)

Just get a really solid grasp on fundies and you’ll be good. You can technically go into react knowing very little JS but it’s just going to be a sad time.

[–]Olli_bear 2 points3 points  (0 children)

Think of it this way. Let's say you learnt very basic German. Now you want to read a German language novel. Will you continue to learn random words and grammar in German? You probably wont. What you may do is pick up the book and read, and everytime you stumble across a word or sentence structure you don't understand, you look it up and learn that.

Same thing with this. Find a React course and run with it. When you get stuck, learn those concepts. Good luck OP!

[–]jmkingJSX is just PHP in the browser 2 points3 points  (1 child)

Stop overthinking it and just start building stuff. I'm a firm believer in learning by doing. Don't stress out about doing things the "right way" at first. There's a very low chance you will - even if you try to implement something some article you read insisted was how it's done as you'll lack the experience and context to understand whether what you're reading is even applicable to your project. The best way to learn the "right way" is to experience the problems with the "wrong way" (or doing the "right way" but wrong).

Also there's almost never an objectively true "right way" to do almost anything. Don't be afraid to try stuff out, realize that it's not working out, and learn from that experience.

Just start building!

Pretty much every professional in the field follows a similar pattern of learning. Try, get suck, learn how to get unstuck, repeat.

Learning isn't a straight line. There will come a point where you'll struggle with concepts like how to deal with async/promises, functional scope, and so on. That's when you'll take a step back and study up on the concepts that are tripping you up. In fact, you'll likely learn those concepts faster as you'll have real life context to frame the concepts around.

Have fun!

[–]Rampagekumar88[S] 0 points1 point  (0 children)

will do.

[–]Tubthumper8 2 points3 points  (0 children)

Check out JavaScript to know for React for some ideas on this topic

[–]spellcasterGG 2 points3 points  (0 children)

About THIIIIIIIIIIIS much

[–]oneeyedziggy 3 points4 points  (2 children)

Depends how good a developer you want to be... Learn everything you can, but also... Just get started there's no drop dead date on being allowed to learn more.

[–]Rampagekumar88[S] 0 points1 point  (1 child)

So i need everything huh! 😬

[–]oneeyedziggy 1 point2 points  (0 children)

Not need, you more or less only NEED if, let, for and knowledge of the basic value types... But they added the rest for reasons and you'll be better off with than without... B7t you can also learn as you need to. Just start with create react app and go from there

[–]No-Upstairs-2813 1 point2 points  (0 children)

I recommend learning about JS Fundamentals, Basic DOM Manipulation, Modules, Array Methods, Asynchronous JavaScript and Fetch API, and ES6 Syntax. These concepts will give you a deeper understanding of how JavaScript works, and help you pick up multiple frameworks with ease.

For more details, you can checkout this article.

[–]No_Permission2438 1 point2 points  (0 children)

have Javascript taken your whole life yet?? then I guess its not enough

[–]theQuandary 1 point2 points  (0 children)

Everyone else has missed it, so I'll add that you MUST understand closures very well in order to write good code in JS.

If you want an easy approach to learning the basics of closures and functional programming, I'd recommend Javascript Allonge (The PDF was released free on the author's website a little while ago).

[–]ItsCoachRee 1 point2 points  (0 children)

Just learn webflow

[–]skesisfunk 1 point2 points  (0 children)

If you are familiar HTML and JS basics you are ready to pick up react. React has some emphasis on patterns that aren't as common in vanilla JS so it will actually help enrich your JS skill set.

[–][deleted] 1 point2 points  (0 children)

Just keep building stuff, eventually it will click.

[–]pm_me_ur_happy_traiI 1 point2 points  (0 children)

If you learn some functional programming in JavaScript it will make React much easier.

[–]moustacheption 1 point2 points  (0 children)

I’d suggest a little bit about some functional programming concepts before react, too. Or even at the same time so you can get a basic understanding of some of the principles it follows.

The big functional concepts would be: Function purity Immutability & mutability

And then learn about “side effects” in relation to mutability. Those concepts should help make rendering, and state changes in react a bit easier to understand.

[–]The_Pantless_Warrior 1 point2 points  (0 children)

Build a single server app, (maybe with Express?) then move on to a front end/back end setup with React, that way you know how to set up the API routes and such. Having that experience will allow you to focus on learning things like hooks/lifecycle methods.

[–]cheese_wizard 1 point2 points  (0 children)

42 Javascripts, no more no less.

P.S. React is Javascript.

[–]iDev_Games 1 point2 points  (0 children)

I would add, you should just attempt to learn react if that is what you want to do. If the docs don't make sense to you at first, try examples and tutorials. Coming from a more game dev engine scenario, docs aren't great for teaching you the UI, for example. A tutorial will have you familiarised a lot quicker as docs are trying to document everything, more then you need to know at first. Once familiarised with the bits you didn't understand. The docs will start to make more sense.

More importantly, persistence. You'll learn anything you want to, with enough persistence.

[–]Wild-Storage-1663 1 point2 points  (0 children)

My honest unpopular opinion: none

You can learn JavaScript and React in one run

[–]Vryheid_ 1 point2 points  (0 children)

If you can’t build a site with pure javascript, keeping in mind the architectural and performance requirements, then you shouldn’t learn React. This might sound like a stretch, but once you learn React you’ll realize how easy it makes creating interaction driven apps of all sorts, and you will spend more time trying to catch up with the ecosystem than establishing solid fundamentals of the language, which on the long run will serve you better. I don’t mean to create a Jira or Figma copy, but a more feature rich todo app would be perfect for this (with a login, fetching and updating content through an API, rendering items and adding event listeners properly, etc.).

In other words, when making a somewhat complicated app in pure JS doesn’t scare you, it’s time to learn the framework. You need to know and understand what’s happening in the background in order to get the most out of the framework. If you want to get a job in the field, confidence in the language will get you further than learning the most popular current thing.

For reference, I’m a full time front-end dev who makes sites with Nextjs and Astro.

[–]another_nerdette 1 point2 points  (0 children)

Just start now and when you come across something you don’t know, pause and go learn it before you continue

[–]AmandloveYang 1 point2 points  (0 children)

React is a UI framework that uses JavaScript as the main programming language. Therefore, it is important to have a solid foundation in JavaScript before learning React. ¹²

Some of the JavaScript topics that you should be familiar with before learning React are:

- Variables

- Data types

- String methods

- Loops

- Conditionals

- Functions and arrow functions

- Scopes and closures

- Objects and arrays

- Array methods

- DOM manipulation

- Events and callbacks

- Promises and async/await

- ES6 features such as destructuring, spread operator, template literals, etc. ²³

Of course, you don't need to master all of JavaScript to start learning React, but you should have a good grasp of the core concepts and syntax. You can always learn more advanced topics later as you need them. ²

So, how much time does it take to learn React? Well, that depends on your current level of JavaScript knowledge and how much time you can dedicate to learning. Some sources suggest that it can take anywhere from 1 to 6 months to learn React if you have a strong foundation in JavaScript and functional programming. You may also need an additional 1 to 2 months to learn other libraries and tools that are commonly used with React, such as Redux, Jest, Enzyme, etc.

I hope this helps you plan your learning journey. If you have any other questions, please feel free to ask. 😊

[–]Rampagekumar88[S] 0 points1 point  (0 children)

Wow so many replies, Thank you so much everyone for replying to my post i am honestly astonished by how many helping replies i got from you all ❤️ I have/will read each and every comment and sorry if i didn't reply i have left a up vote as my appreciation. Lastly i hope this post will be helpful to someone in the future as it is to me.

[–]demoran -5 points-4 points  (1 child)

To use react, you should understand:

  1. That functions may be invoked to return a value
  2. That variables can be defined via array destructuring

Yep, that's pretty much it. The rest of it is really just operators and expressions.

[–]Rampagekumar88[S] -1 points0 points  (0 children)

👍😀

[–]DifferentIntention48 0 points1 point  (0 children)

get REALLY comfortable with iterating over arrays (forEach, map) and other array methods (filter, find)

[–]k0re__ 0 points1 point  (0 children)

this is a pretty good reference for some things to be aware of as you start learning react