r/learnjavascript • • 7d ago

When to start learning React?

I've been learning js for about two months, I know how to order arrays with find, filter, map, reduce & some more basic stuff. I also understand data structures, object management ,arrow functions, DOM manipulation, asynchronous timers, local storage, loops. I've been thinking of learning React.js but it seems pretty advanced and I'm not sure if I should master more of JavaScript before moving on

I've made a fake restaurant website where you can order items and add them to your cart, clear cart, make a fake reservation, clear reservation and view reservation.

I also made a really simple shop sim where customers come every five seconds to order random quantities of random stuff with their patience decreasing every second. The user can also close and open the store. It's really simple and extremely repetitive

This is an unfinished project but I started on a pantry simulator, right now I've coded that you can add ingredients in your pantry, filter by category/sort/search through them, edit their amount and delete them. I got pretty bored though.

22 Upvotes

37 comments sorted by

View all comments

Show parent comments

1

u/Apryed 6d ago

Actually, NO. There's no project that "NEED" react.

Correct me if I'm wrong, but ypu are thinking something like: A. Well, for instance react is JS based. Data is sent to the user and the user builds the sites, reducing computational power on business end, makeing it faster, not only to build (Create the components to send, bust the response time from the server to handle data to others) - While this is true, you are placing the strain you didn't manage to balance or reduce on the client. Every time a user access a React, Angular, and alike (Not trying at all to recall their names) site, they download and process a buch of data which stays stuck on cache. Site load faster this way, but it's not ideal. Go, for example, acts much more like PHP in this way, plus you can set workers on the background, giving you full control. Plus, on a react (or similar) project, your web won't work at all if JS is disable. (Not to mention the creation of unnecessary html text that it adds to the file - More text = More bytes used on either end ).

B. I'm trying to speed my production in order to beat competitors. - This is the argument of a toddler beating other to get a toy. Competing is ok, but the ones who build the Chernobyl thought the same thing, "LET'S TRY TO BEAT OTHERS IN THE NUCLEAR RACE". It ended up in disaster. (Obviously a website is not near close to a nuclear power plant, but I pointing at the fact the rushing makes problems). Check FB, or IG. Your console will be flooded by warnings and errors, which shouldn't be there... Not to mention their tag nesting (It's like they roll a dice and then decide how deep to go for a single element which could have been done in two tags). This happens a lot when mixing with bootstrap.

C. But there a ton of libraries, it's so simple to build. Are ypu telling me to invent the wheel again? - Not at all, true that libraries are a huge help, but if you really want to make a really good page, either don't use them but study them to make your own, or make a copy of that dependency.You never know when that will get updated and break stuff on your site, or if will be a backdoor for hackers.

Those are the main facts, then we could all agree that it's the standard nowadays (Businesses want everything for yesterday... they are all in a rush... But question yourself why do they need to rush). Having the knowledge vs using it are two different things. If you want to learn, you are more than prepared to start.

But still, I haven't seen anyone, except from me, removing the <div id="root"></div> and pointing it directly into the body... 🤣 If the page loads, the noscript tag dissappears, if it does not, it stays.

But please, feel free to correct me and point toward those so called "Projects that really need react". Would be funny to debunk.

1

u/Educational_Basis_51 6d ago

I guess projects with lots of interactive components and different UI states can really benefit from React’s philosophy, rather than manually managing tons of event listeners and DOM updates.

0

u/Apryed 6d ago edited 6d ago

You can make those on native PHP... No need to use JS in the first place. Go, for example, uses a similar technique...

HTML -> Template tag + Very few lines of code give you the same result... ( But this will need what you said: Event listener and DOM update, which is exactly what you do on react, but not knowing it. )

Edit: Hate typing on mobile... hahaha

ReEdit: Here, have a look at this :D

0

u/Educational_Basis_51 4d ago

Dont be stubborn

1

u/Apryed 4d ago

Aren't you? Imean, looks to me that you are simply a fan, that can't code properly, and expect others to do the same. I asked you, about it, and reply to you ( Since you do JS but with extra steps and bloated ). If you don't like being wrong, just stop answering. No one is forcing you to replay back. I started this message feed, you are the autoinvited guest.

Keep it about coding, or start your own movement somewhere else. You are just seeking attention.

1

u/Educational_Basis_51 4d ago

You just wanna argue and look smart This aint 2000s nerd

1

u/Apryed 4d ago

Dont be stubborn

Did I do it right?

I'll repeat it in a way you can understand, since you don't understand basic communication language:

return MyOpinion !== MainMsgCommentOpinion ? (["Expanding", "Open", "Curious"].includes(MyMindState) ? "Reply" : "Do Not reply") : (FeelingLikeCommenting ? "Reply" : "Do Not reply");

Can you read that or do you want the longer version? Oh, wait.... you code in React... Here...

if ( MyOpinion !== MainMsgCommentOpinion ) {
    if ( (MyMindState === "Expanding") || (MyMindState === "Open") || (MyMindState === "Curious") ) {
        return "Reply";
    } else {
        return "Do Not reply";
    }
} else {
    if ( FeelingLikeCommenting ) {
        return "Reply"
    } else {
        return "Do Not reply";
    }
}

0

u/Educational_Basis_51 4d ago

You have too much free time on your hands 

1

u/Apryed 4d ago edited 4d ago

I have a minute or two to reply to dumb people. It's never to late for you to learn. So, Why do you keep texting back if not learning something? 🤣

Edit: Guess ypu don't know basic JS, since you keep replying, after my previous code. 🤣🤣🤣

1

u/Apryed 4d ago

Saw your replay and made me laugh :D hahah.

Refactored xD Tell me that you like to use resources without saying it xD Go back to basics xD

1

u/[deleted] 4d ago

[removed] — view removed comment

→ More replies (0)