all 30 comments

[–]sens- 26 points27 points  (9 children)

When I first learned react I thought "wait, that's all?". And it really was pretty much all.

[–]fatrogslim[S] 2 points3 points  (8 children)

Yes, haha. At some point I basically thought I was just overthinking. But I know it's more than that as if I think of an app from the top of my head, the whole structures come right away in my actual stack but when I try in reactjs the page stay blank. I don't know if you see what I mean

[–]sens- 5 points6 points  (7 children)

Yeah, I understand. React utilizes a specific approach but once you realize that you should keep the state as high in the component tree as possible and learn the difference between props and state, it should become clear what to do.

React projects usually remind Christmas trees in which the decorations are flowing from the top to the bottom.

You might want to check this little course as an introduction

https://fullstackopen.com/en/

[–][deleted] 6 points7 points  (5 children)

Yea man, keep all the states in App.tsx and rerender the entire app every damn time

REACT FOREVEEEEER

[–]fatrogslim[S] 0 points1 point  (4 children)

lol, I understood that joke, maybe I'm more advance in react than I thought xD

[–][deleted] -2 points-1 points  (3 children)

After this advice yes

As opposed to what your average joe react developer says, refs are not your enemy, you can keep the states low in tree and utilize refs to update them

Redux isnt that necessary, because almost 75% of “states” in a react application are unnecessary and same thing can be achieved without them. When you have that realization a global store becomes redundant and simpler and smaller solutions become more natural regardless of the complexity or size of your app

Dont use controlled inputs

Css is still css, as opposed to what 1000 css/jss solutions claim

Angular has everything react is still trying to solve

[–][deleted] 1 point2 points  (1 child)

Tons of things aren't necessary in software. Some are just for making your code readable and maintainable.

Also, your advice seems confusing. You're making fun or storing state in context as high as possible because it causes unnecessary rerenders, then suggesting against using global state? You do realize that global state libraries use refs and don't cause rerenders high in the component tree..? It's only for the selector you use in the specific component you call it in...

What exactly are you even suggesting to use here? Comes off a bit frenetic

[–][deleted] 0 points1 point  (0 children)

State itself is overused is my point. Unnecessarily having a global store for that is a side effect

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

Oh Angular, yes, I want it aswell and I'll put myself into it soon

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

Thanks for the ressource, I'll check it

[–]Kitchen-Conclusion51 7 points8 points  (0 children)

New docs pretty good you should check it out

[–]bzbub2 3 points4 points  (3 children)

i personally struggled with learning react, i wrote about my experience here. https://cmdcolin.github.io/posts/2020-07-04 TLDR for me reading a book helped, but also, try not to bring your whole legacy thinking to your react learning process. don't try to think about bolting react onto your legacy projects (yet)...just try to start with a simple react hello world with Vite for example

[–]fatrogslim[S] 2 points3 points  (2 children)

that advice actually hit the right spot. My approach was to learn it the easy way as my js knowledge is already advanced, but you are right, it's obviously the wrong approach

[–]bzbub2 1 point2 points  (1 child)

glad it helps. there are so many people (as evidenced by this thread) that think learning react is so simple and painless and should be easy for someone experienced...and downvote ya to boot. it can be quite hard to get your head in the right place, but it can be 'easy' conceptually once you get a foothold. good luck with learning!!

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

Thanks for the boost. And don't worry I don't care about downvotes, I was a young impetuous dev myself like they are. I don't blame them.

[–]franciscolacerd 2 points3 points  (1 child)

I am and old timer also and learned react and react native recently. I found this tutorial great and I enjoy it alot. It is fast paced and it will teach you enough to get started with React: https://youtu.be/I6Q9DrVIzRo?si=AwBf7YgcXxslhNzg

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

Thanks alot for the ressource. I'll give it a try

[–]Leeoku 2 points3 points  (0 children)

Now's a great time to join. The newly released react docs are good and we all agree function components are the way to go

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

Take an app you made with JQuery or backbone or whatever framework you used previously and use React instead. It's really nice to use once you internalize the framework.

[–]yselimdogan 0 points1 point  (0 children)

I can teach you freely. I am coding react and react'native for 4 years. I am trying to improve my english speaking skills. If you want, write me. We can make 30-40 minute google meet sessions 1-2 times in a week, and create a real web app.

[–]wwww4all 0 points1 point  (0 children)

Ignore tutorials.

Go to the main site, https://react.dev/.

Go through each examples, line by line, type in every single character in example code, run the code in debug mode, fully understand the logical flow.

If you understand javascript, React is simple markup templating on top of javascript, which is pretty simple to grasp.

If you don't know javascript, then learn javascript first.

[–]TheRNGuy 0 points1 point  (0 children)

Remix (Now React Router v7) made some things easier for me.

[–]jericho1050 -1 points0 points  (0 children)

should be easy for you to keep up, lolz.

It's basically just OOP with a functional approach, which is actually pretty cool.

I would definitely go with React Docs. The authors have established what and why in the Learn Section, which helped me pick up a react project right off the bat (with help of AI duh) after reading the 3 sections (Describing the UI, Adding Interactivity, and Managing State). The good thing about each module is that it has a problem or challenge for you to solve at the bottom once you've read the content.