DEV Community

Discussion on: Help! I am Overwhelmed With React and It's Preventing Me From Finding A Workflow

Collapse
ben profile image
Ben Halpern • Edited on

Hosting (public facing)? I can't install packages onto my shared hosting plan on the fly. I can't ssh into it. No root access. What do I use instead? Do I run a server here at my house?

If I understand what you're asking, I'm pretty sure you'd want to "build" react locally and then run include it as a JavaScript file on your site. The host shouldn't need to know about packages.

Is the core React library alone not powerful enough? Do I need to install a CMS or other packages for react to be useful, much how php on it's own doesn't provide all the abstractions needed for task x, y and z?

You do not need to install a CMS or anything else. React is nothing more than a view library for declaratively rendering complicated client states. Tie-ins with other frameworks are a separate thing, but often blended together for convenience, like Gatsby. You can run a React client on any backend, like PHP. You could load the data into, say, a blob of JSON on the client as a data attribute and have React play with it however you like.

The most important: What (preferably free) tutorials/learning resources do you recommend? Maybe my searches haven't returned the best results.

This comes to mind:

Not sure what else is out there in the React ecosystem at the moment, but perhaps others will chime in.

You've identified what I think is the core difficulty in React today: There's a lot of tooling and interesting things you can do with React that it's hard to figure out the basics or get beyond what's been abstracted away with tools like Gatsby.

I haven't been super involved in React lately but I adopted it really early on and it was much easier to wrap my head around it before the ecosystem got so complex. Your background in PHP might give you a different type of coupling you're not used to here.

Let me know if I've misinterpreted any of your issues.

Happy coding!

Collapse
nickfazzpdx profile image
Nicholas Fazzolari Author

Thank you for the insight, and I'm about to sit and read the article.

Collapse
johnhorner profile image
John Horner

React is nothing more than a view library for declaratively rendering complicated client states.

Could you break that down even further maybe? I totally get why OP is puzzled and frustrated. I've done React tutorials and succeeded in all the assignments and still don't 100% get it.

What is it that we need React for which we couldn't do with jQuery, for instance?

When I look up React on Wikipedia it's described as a Javascript Library.

When I look at the history of React I get this weird back-story:

in 2012 Mark Zuckerberg commented, "The biggest mistake we made as a company was betting too much on HTML5 as opposed to native".[29] He promised that Facebook would soon deliver a better mobile experience.

Inside Facebook, Jordan Walke found a way to generate iOS UI elements from a background JavaScript thread.

Which strongly implies that React was invented for iOS native interfaces, not regular HTML websites.

Collapse
ben profile image
Ben Halpern

What is it that we need React for which we couldn't do with jQuery, for instance?

There's nothing you couldn't do with jQuery, but React makes keeping track of the "state" of a page about 10000000x easier. It's also generally more performant in complicated UI situations because it does minimal DOM manipulation and does most of its work in memory via what it calls the "virtual DOM".

React lets you code as if you were throwing away the whole page each time something happens and rendering from scratch based on the new situation. If you have an add to cart button and a cart icon displaying the number of items in a cart, with jQuery it's possible for things to get complicated quickly as different actions affect different things. React makes complicated UI pretty simple.

jQuery is much simpler for just dropping in and working with, but React eliminates complexity if you lean in to it.

React Native definitely helped React gain traction and commitment from Facebook. It was a big reason people finally started paying attention, but its true origins are pretty inherent to the problem of generating complex UI. Angular at the time truly sucked, and so did lots of stuff that was pretty popular. React really changed things.

React took good established declarative programming ideas that were already popular in game dev (I don't know this first hand, but I've heard it described this way and it makes sense). Games are an incredibly complex state management problem and they'd solved a lot of these problems before UI development needed to.

Thread Thread
niorad profile image
Antonio Radovcic

About game-dev: Games often use immediate-mode-GUI, which has some overlap with how React works.

medium.com/@Huxpro/is-reactjs-imgu...