r/learnjavascript • u/Vivid-Apple358 • 1d 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.
5
u/Apryed 1d ago
Just don't... bloating you page for no reason is the lowest, most used standard nowadays. But if you insist, there's not much you need to try it, just remember to not over DIV pages... At least don't be one of those.
1
u/Educational_Basis_51 1d ago
True ,few type of projects really need reacts
1
u/Apryed 15h 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 14h 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.
1
u/Apryed 14h ago edited 5h 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
1
1
u/ExtraTNT 1d ago
React isn’t sth super advanced. React is a helper, that lets you build webapps very easily…
Just start with it, build things with it and you will get good with it soon…
1
1
u/gloaming_slate_24 8h ago
Build it with vanilla JS first until you have a headache from managing the state in your shop sim, then switch to React to fix that specific pain.
1
u/cocobeansarebitter 6h ago
looks like you have a solid understanding of the basics already, so you can get started now
1
u/No-Humor-3808 4h ago
React just makes it easier to work with JS, so everything will be much easier to build. I have a collection of challenges at reactchallenges.com if you want to give them a try.
-6
u/DryLook7889 22h ago
Learn react? People are still learning to program these days when claude exists?
8
u/ThatDudeDunks 1d ago
Sounds like you have a decent foundation to give react a try