Why React? What is React? Should I learn it?

JavaScript library ReactJS is used to create interactive elements for websites using JavaScript.

JS libraries provide prewritten JavaScript code you can use for common JS tasks, relieving you of the time-consuming (and unnecessary) task of writing the code yourself.


react-1

Now,let's get back to React.. In addition to the many different JS libraries out there, React JS is also one of them - but what makes it unique? What is React JS used for? And why should you learn React JS? And is it better than other JavaScript libraries? There are many questions like these which may be coming into your mind.and its ok to have such sort of questions if you are willing to work with it.


Why do Javascript developers use React JS

This JavaScript library helps developers build user interfaces, or UIs, for websites and web applications. In other words, UIs are the menus, search bars, buttons, and anything else people interact with to USE a website or app.


But wait.. You may also be asking at this point that weather the React JS library is Frontend or Backend ? And the simple answer to this is: Front end. This is used exclusively for UI building or you can say for client side. both mean the same. Here is an example of my website which I created using React

react-2 react-3

JSX

Now , the most Important thing is: the heart of any website. At the heart of any basic website are HTML documents. Web browsers read these documents and display them on your computer, tablet, or phone as web pages. During this process, browsers create something called a Document Object Model (DOM), a representational tree of how the web page is arranged. Developers can then add dynamic content to their projects by modifying the DOM with languages like JavaScript.


JSX stands for Javascript extentions and React JS extensions make it easy for web developers to modify an application's DOM with simple, HTML-style code. And, since all modern web browsers support React JS, JSX can be used on any browser platform.


Virtual DOM

This approach enables the declarative API of React: You tell React what state you want the UI to be in, and it makes sure the DOM matches that state. This abstracts out the attribute manipulation, event handling, and manual DOM updating that you would otherwise have to use to build your app.

react-4

This kind of selective updating takes less computing power and less loading time, which might not sound like much when you’re talking about a single blog comment, but—when you start to think about all the dynamics and updating associated with even a slightly complex website—you’ll realize it adds up to a lot.


Should you use it?

You may have built many website and apps using html, css and vanilla javascript and working with them is also easy, but, there are some cons too.

Those are:-


Example Projects:

there are some of my project links that you can check out if you wanna see what kind of entry level projects can you build with it. Check them out...


Hope that I was able to answer most of your doubts regarding React . But if still there is some confusion and you want to discuss it with me, then you are free to do so . You can just ping me on social media and i will get back to you.