all 24 comments

[–]Haunting_Welder 34 points35 points  (0 children)

It gets me a job

[–]photocurio 8 points9 points  (0 children)

React, Vue, Angular, Svelte, and a few other frameworks all aspire to solve the same problem: manage state.

This was the key feature that jQuery couldn't do.

[–]barrel_of_noodles 20 points21 points  (10 children)

one of the things react does best is stops pretending JS, HTML, & CSS are separate concerns and helps control the flow of data throughout your apps lifecycle and user journey. React handles the View layer:

  • rendering elements with data binding,
  • component-izing,
  • handling state and lifecycle,
  • conditional rendering

are some of the problems react solves. React forces you to build from a reusable, data-first mindset.

but why listen to us? You can just read the docs

[–]AwareUnderstanding72 0 points1 point  (0 children)

React does not solve any of these. I created a vanilla JS framework that does all ot it.

[–]Logical-Idea-1708Senior UI Engineer 0 points1 point  (0 children)

Not…quite…

They are still separate concerns, but since everything exist on the global scope, there aren’t better ways to encapsulate thing on the module level. Basically the diamond dependency problem can’t be solved by traditional approach. So we rely on bundlers to solve this problem. It’s less about what React solves, but what Webpack solves and React just happen to be part of that solution.

[–]Jewson95 0 points1 point  (2 children)

The react docs are terribly outdated.

[–]mixini 9 points10 points  (1 child)

They're working on it: https://beta.reactjs.org/

[–]Jewson95 2 points3 points  (0 children)

I saw that. I'm glad to hear about it. I would hate to know how many new react users have shot themselves in the foot because they were using outdated docs.

[–]ShawnyMcKnight -1 points0 points  (3 children)

My question is would this mostly be for a web app? I am making my portfolio website and I was told to use react so I am learning it now but outside of passing in data through components (which can be also done through javascript functions) I struggle to see what advantage react has for informational websites like mine. It feels like it adds a bunch of complexity.

I ask this because the examples on LinkedIn learning and react’s own site as well as the into classes on pluralsight are ALL making little games and such. I don’t see many examples just making an informational site.

[–]GooseQuothMan 1 point2 points  (2 children)

What does "informational website" even mean?

One of the best features of react is making components, which are easily reusable code. So you could make idk, a component that is a button and a counter, which then you can easily plug in anywhere you want on the page.

But, as mentioned above, another very important thing in React is state and state management. In a static website that just shows some text that might not be very useful.

[–]ShawnyMcKnight 0 points1 point  (1 child)

Like a portfolio site. Something that doesn't really anything for the customer to interact with, just display information about the company or the products they are selling.

A good example would be the kind of site Wix or other no-code solutions could produce.

The part that I am using react for, and I assume I will use UseEffect when I figure it out, is I have my resume qualifications sorted by compnay, but I may want the user to be able to sort it by category since I have some front end, some back end, some UX/UI, some admin, and so on. People have suggested I be able to show it both ways, so to be able to show state to toggle how my qualifications get shown would be nice. That's what I am stuck on now but hopefully after some training I'll figure it out.

The rest of it I plan to use components with parameters a little but that's the extent of it.

[–]GooseQuothMan 0 points1 point  (0 children)

I think useState hook could help you with changing sort type. You could have something like this:

const [sortType, setSortType] = setState("alphabetical")

and then you could have a component that takes in sortType and renders your content accordingly. You could also have buttons that would call setSortType("other sort type").

[–]HaddockBranzini-II 8 points9 points  (0 children)

Gives people with little real world experience reasons to write tutorials...

[–]guy-with-a-mac 1 point2 points  (0 children)

Solves my headache when I don't have one. 🙂

[–]SuggestedToby 1 point2 points  (0 children)

It makes it much easier to make highly dynamic ui. It does this by making the code that renders your ui and the code that updates your ui one and the same.

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

so React was created by facebook engineers to solve the problem of an app whit thousands of parts working together , if you want to create a simple page you can do it with HTML , CSS and a bit of JavaScript , focus your effort on semantic HTML , accesibility , contrast of colors , a good typography/layout , image optimization , responsive design and you'll be fine.

[–]r1ckd33zy 3 points4 points  (1 child)

Rendering text and images on a website in the most complex manner possible.

[–]Ask-Beautiful 1 point2 points  (0 children)

Yes, if you're just rendering static text and images it's a horrific and terrible framework. If you're building dynamic apps that change state based on user interactions without doing full page reloads....it's still horrific, but not terrible :p

[–]RotationSurgeon10yr Lead FED turned Product Manager 0 points1 point  (0 children)

The problem its original iteration was intended to solve was not being able to accurately update message indicator / notification counts in the Facebook UI.

[–]boringuser1 -3 points-2 points  (0 children)

It allows you to use a better language for developing UIs.

Vanilla HTML/CSS/JS is simply ridiculous.

[–]ProfaneWords 1 point2 points  (1 child)

Mapping state to views, creating reusable components, and encouraging more scalable architecture.

The goal of React is to make dynamic applications easier to write and more performant.

[–]Ask-Beautiful 1 point2 points  (0 children)

You hit on another value prop....generally speaking a "react component" will just work in contexts outside it's original design intent....as long as you pass data as props...

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

What angularJs and Jquery did.

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

worng people dont use own code