What Is React ? Why Would We Use It?

Photo by Lautaro Andreani on Unsplash

Hi everyone,

Actually, sometimes i think “Is life too short to learn react?”. Never mind, forget it. We must learn React for building the best user interfaces. So, today i smy research about “What Is React ? And Why Would We Use It?” I hope, it will be useful to everyone.

So let’s start!

Well, to answer that first question , what it is, we can of course visit reactjs.org the official React.js web page and there we learn that React is a Javascript library for building user interfaces.

That’s a nice sentence. But what exactly does that mean ? Consider an example like Netflix Service, Netflix web site and application. This application is highly interactive and runs pretty smoothly when we work with it. It’s easy to use and we don’t have to wait for anything to load,we have nice transitions. If we go to the My List Page that transition happens pretty much instantly. We don’t seem to wait for a new page to load here and that’s all pretty nice.

I ‘m using Netflix in my browser. so this is a website here. Now, when we use a service like Netflix, it might almost feel a bit like a mobile app, even though I am using the website here because mobile apps give us this great highly reactive user experience. From mobile apps where use that we have smooth transition that it’s fun to use that app and that things happen instantly and at least traditionally websites didn’t always feel like this. 🙁

Traditionally in websites, when we, for example, clickled a link or a button, our request was sent to a server and a new HTML page was sent back to the browser where it then could be displayed. Therefore, traditionally, websites could feel a bit clunky.

We might have that latency where we wait for this new HTML page to load and so on. It’s this request and response cycle,which we can break up with JavaScript. So at this point we don’t even need React, it’s just a JavaScript which can help us here because JavaScript is a programming language that allows us a developer to run logic in the browser. The great thing about that logic in the browser. That it can do things that manipulate what the user sees. JavaScript in the browser is able to manipulate to so-called Dom, the HTML elements that are rendered onto the screen. We can manipulate this with JavaScript and that allows us to change what the users sees without fetching a new HTML page. We don’t need to request a new HTML page just to present something different to the user. So that’s why JavaScript can help us and since React is JavaScript library. It looks like it can also help us with that. It might be extra building block, and indeed, React.js is a client-side JavaScript library. It helps us with writing that client-side JavaScript code and it’s all about building modern reactive user interfaces for websites.

One question remains, why do we need React ?

At this point, we know that JavaScript is helpful, and i hope could explain why it is. But how can React specifically help us, why might we want React in addition to JavaScript? We , as a React developer, work on a higher level, which makes working with React and which makes building complex user interfaces way easier. And that is why we want to use React.js, it makes building modern,rich complex user interfaces easier.

And it does so, by giving us a higher level syntax, where we write code in a declarative way, in a declarative component-focused way, we define what we wanna have on the screen. What the end goal is. We create these custom HTML elements and React will do the rest.

Thank you 🙂

See you next articles

You may also like...

Bir yanıt yazın

E-posta adresiniz yayınlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir