DEV Community

Discussion on: Why use React instead of JavaScript HTML and CSS

Collapse
 
johnmunsch profile image
John Munsch • Edited

Even if you use React, you're still using JS, HTML, and CSS. What you're getting with React is a library that lets you create custom components.

Unfortunately a lot of the replies you're going to get are from people that assume you cannot have components without the use of React, Angular, or Vue and that's simply not true anymore. Most of the browsers now support custom elements (for example, "<my-fancy-search>" or "<pie-graph>") and the few that do not can load up a polyfill and get the same ability.

What you probably want to do is build components to break up your page into chunks of code which are both easier to debug and potentially easier to reuse across pages. You can use any of the popular libraries I mentioned above to help you do that or you can start using Web Components to do the same thing (for example, the current version of YouTube uses Web Components and the Polymer library to make it easier to write the components).

That component style page design is not unique to any of the libraries but it does make it much easier to conceptualize building a page. It allows you to say, what if I could build a page using elements which make sense for my page ("<home-page>", "<about-page>", "<user-page>") and sub-components on each of those pages to break them up rather than always having to start at the same fine grained level of abstraction that is "<div>", "<span>", "<input>", etc.

Collapse
 
mraza007 profile image
Muhammad

True !!!

Collapse
 
ecjep profile image
ecjep

Hi, you are right.
and i wish to add one important thing that people ignore :
React, backbone,angular and so on ... are just "Layers" on javascript.

My advice to every one : learn javascript;
no lib or layer will do you any magic...

angular was made as an extention to JAVA GWT, it was meant to help JAVA developers to work with gwt, which for now is quite dead :(

d

Collapse
 
alemvik profile image
Alemvik • Edited

Exactly - frontends have too much magic and are heavy. Stick on WebAssembly (blazor, SignalR, gRPG), CSS (flex boxes), Javascript. If you need, feel free to scarvage other frameworks (e.g. Formantic, Bootstrap, w3.css) and bring the code to you. You want to (really code and control) or (you want to just apply recipes / procedures and be stuck in a framework) ? Saying that, I use scss, jquery lol. Bottom line, I suggest you get proficient in css, html5, javascript, jquery and then you do what you want, but saving time is not always true in the end. web frameworks have their own bugs (plenty). Saying that, I like asp.net core a lot lol.

Collapse
 
gatopeich profile image
gatopeich

I wish I had known better when the newly hired Front-end "developer" insisted in that our perfectly working HTML5+CSS+Javascript app was "old" and we should start an Angular project from scratch.

I saw issues with discarding existing website that was working fine (and fast!), only the looks of it needed to be changed, but he was mad about it. I had to allow him to work within his knowledge, so Angular was it.

Months later he was struggling to maintain a code base of hundreds of files. I looked at this in horror reminiscent of J2EE times: 90% boiler-plate code, many many "components", an ever-growing bug list. Essential features present in the "old" Web UI were just not portable to Angular because they were not "the Angular way".

Today I am checking Vue.js as a potential way to simplify our "old" Javascript, and maybe Web Components if our UI becomes more complex (than I can foresee, really).

Collapse
 
sswam profile image
Sam Watkins • Edited

Try Svelte, it's by far the best front-end framework I've seen. It actually makes things easier rather than more difficult, which is more than I can say for the other frameworks I've tried. There is a very good online interactive tutorial which doesn't take long, and gives a great overview of what Svelte can do.

Thread Thread
 
gatopeich profile image
gatopeich

Thanks I am trying it