Yeah but React is really good. A lot of these articles[0] delve into an analogy that they twist into a complicated mess and say "hey look at how complicated frameworks are." But React isn't complicated. Most kinds of interaction, even for the smallest apps, are easier with React than with vanilla JS. I've never felt like I'm managing a factory factory factory when using React. And if I do, it's easy to peel back the veil and write vanilla JS alongside React.
[0] I realize this was probably one of the first of such articles and thus has fallen victim to [1], but someone did post it today.
>Most kinds of interaction, even for the smallest apps, are easier with React than with vanilla JS.
I think the difference isn't between the difficulty/complexity of that individual action but the overall complexity of everything up to that point. Once upon a time the simplest web tutorials might have involved "Open a text editor (already on your PC), write these 10 lines, save it in this directory on your web server or open the file in a browser". Now even the simplest tutorials have way more dependencies/prerequisites and often involve building projects, installing things, framework choices, etc
Once you're already setup and going it may not feel complicated but from the perspective of the dude just trying to buy a hammer it certainly looks complicated.
Sure, to me a library is something you call, like ReactDOM.render(), React.useState(), etc, and a framework calls the code you create. You create files and modules for a framework in the way that it dictates, and a library doesn't constrict you in any way.
But defining react as a framework or a library isn't easy, the word "React" isn't just one thing. JSX, initializing script, and the app skeleton are all optional to using React, yet React without JSX doesn't exist, everyone does it, like bundling your web app is a must in production nowadays.
React wasn't so much a framework when it started, you could add pieces of react in different parts of your page, to the point people sometimes argued that it was overkill to have the entire page be a react app. It is slowly walking into the framework direction, and the new react.dev docs violently suggest you use a react with a framework. A developer doesn't just "start" using react in these times, they need to understand a lot to create a full project with react.
Oh, this is new to me. It's not recommending create-react-app, it wants me to use Next.js or something. Yeah that seems like a bit much. I was even doing a React project recently and went straight to create-react-app, bypassing all this, haha.
You can use it for only a part of your UI, and you can implement any parts of your UI that are embedded within react components without react as well. It doesn't lock you into doing things its way in any manner whatsoever, it is literally just a library with functionality that you can utilize wherever relevant in your app.
> completely changes how you write your frontend
JSX is not an integral part of react. It's quite feasible to use react without using JSX, and I have done so in the past in some of my side projects when I wanted to avoid setting up a build system for a while. JSX just compiles down to plain old function calls, and you can use those directly without JSX without any issues.
> (JS -> JSX with embedded HTML)
JSX doesn't really have embedded HTML, it's just syntactic sugar for plain function calls that only somewhat approximates HTML.
> has lots of react-* libs built around it
Which are usually either libs that implement a react component with react or just wrap some non-react library in a way that's slightly easier to use than using the library directly in an app using react, but it's not like that latter is impossible or even difficult.
> comes with a script initializing an app skeleton
Such scripts exist, but they are not integral parts of react and are by no means required to use react. React is just a library, and if you want to, you can use it without doing anything else except including a single .js file with a <script> in your html file, even if the more usual way of including react in your project is a lot more convoluted.
Yes, you can use React not like a framework, but very few people do that. If you say you're using React, it's assumed you're doing it the usual way (with JSX and all).
You're conflating React the library with create-react-app which is a collection of pre-configured tooling for making SPAs. React on it's own is very much just a library with a couple functions.
The standard docs can go fuck themselves. I've never seen a community try and fuck up a good library as hard as the React community does.
React itself is great. Almost everything built on top of it and every word spoken about it on the internet is garbage.
The incessent focus on shit like CRA, NextJS and people shitting themselves over "NIH" is going to kill React in the next decade and we're going to be stuck with something 10x shittier in it's place. Well done team!
For bad docs, my stuff worked pretty well following them. Is create-react-app really gonna screw up my project?
Will say that the React Native docs suck because they keep trying to shove Expo down your throat, which simply doesn't work if you're trying to actually build a production app, plus it keeps changing and breaking stuff. Or at least that was the case a few years ago; I haven't even gone there since.
Edit: Seems react.dev is beyond create-react-app and now it's pushing some overkill stuff that feels like corporate lock-in. Yeah that's a concern.
Part of that is almost certainly because it is far, far easier to explain how to get started with create-react-app then it would be to explain the various alternative approaches, especially considering how inexperienced on average the kind of people who are looking up how to set up a react project must be (professional developers needing the information for their actual work probably constitute a small minority), even if those alternative approaches themselves are not complicated at all to those who have the prerequisite knowledge to understand how a library like react would be incorporated into their particular setup.
Some inline on(event) attributes can be simpler to enhance basic MPA functionality, compared to pulling in React. I suppose it depends on the requirements and what one is most comfortable with.
[0] I realize this was probably one of the first of such articles and thus has fallen victim to [1], but someone did post it today.
[1] https://tvtropes.org/pmwiki/pmwiki.php/Main/SeinfeldIsUnfunn...