As a total newb who has no idea about these things, react looks like an unnecessary complicated version of html πŸ€·β€β™‚οΈ

Reply to this note

Please Login to reply.

Discussion

Html is a lame version of React.

I must confess I have React Brain 🧠.

Having used most FE frameworks it does just work.

Plain HTML can't do shit, only good for static sites. If you want any kind of dynamic content you need some kind of framework which there are many

Why do so many static websites use react?

Content in a db?

Because apparently developers only learn React now and their brain shrinks, the only thing they can do is use some tools that generate garbage boilerplate for them and they have no idea of what all that means.

Doesn't mean React itself is bad. When React appeared it was a magical revolutionary dream, it was hard to believe, it solved so many problems.

You also get components and other things that come along with react, you don't actually need to use any of react states etc you can just have plain html in ever component with no logic haha

You build with what you know and many people know React.

But... You can put JavaScript in plain html... You don't NEED a framework to have a dynamic site per say.

I'm trying to learn and the shit thing for someone new like me is I have a solid understanding of what's going on, I can build simple apps from scratch but I feel like now there's 500 frameworks to choose from and I don't know enough to make an educated decision when to pick one framework over the other. So naturally I've resorted to building everything from scratch. Which is probably good from a foundational understanding but I know I'm losing hella productivity by not using a framework.

I have up on vanilla js sites once I learned to use react, all you get is pain when you want to build anything more than a very fancy static site haha

I originally started Iris without any framework and learned the hard way why frameworks are used. Now using preact, a lightweight react variant.

I don't know whether to love or hate you yet. Either way I am going down the preact rabbithole.

It's really impossible too make a good webapp and maintain it, without a good framework. Even a UI framework (tailwind/bootstrap etc.) Is pretty essential even if you have to make one yourself.

But why react? Why not Svelte, Angular, or node.js?

Node has a different use case, Angular is needlessly complicated and Svelte doesn't have a mature enough ecosystem.

React is not all that great. bit it has one giant advantage, which is it's huge ecosystem and userbase. Basically anything you do. there is a library for that optimized for react. Basically all libraries that could be used with react provide a react specific version or utilities.

Also for me, it was just that there is a lot of work for someone who knows react.

So here is why I can calm myself down when this happens to me - let's say we did do that and have plain js website. Over time as we develop several things can happen -

- the js file has grown super large now, so we need to split it up into multiple files - this prompts us to find bundlers and related tools like vite, webpack, skypack, roll-up, etc.

- we have more developers working on it and not everyone adheres to the same rules for code style and standard and things tend to break often - linting, prettier, jest, playwright.

- we keep forgetting what the api server returns sometimes so we need to know beforehand what kind of data we get and it should be easy to understand - typescript, zod, etc.

- we need to reuse certain pieces of js + html combination snippets/code, for example - combo boxes and dialogs, so we need a way to make "components" out of it - react, svelte, solidjs, etc

- we our app now has several views each individually addressable - router packages

- we have to share some data with several pages - redux, mobx, zustand, recoil

So all these frameworks are not for immediate achievement of the website but for eventual maintainability and ease of understanding between multiple developers. At least that's how I understand it and tell myself this when I lose my mind.

All those buttons when you click em have to do somethin' 🌱

Yeah I get that if you’re building an app it needs to run stuff to do stuff but I see people using react for static websites.

I don't believe there is such a thing. πŸ˜… A true static website? Like, with zero anything, not even a form?

Forms are html …

Ya but forms need validation and html can't do that for you. And submitting a form means it's not static anyway.

You can do this with SQL though.

I like svelte, sintax looks like html and css Indeed