React - What? Why?

React - What? Why?

React is an amazing library for creating fast JavaScript-driven web applications with extremely manageable code. It allows you to write your web applications using “JavaScript”. Since JavaScript runs on the browser, it will enable creating fast web apps without having the need to wait for page reloads. It means you can now make a web app which feels like a mobile app. These advantages make React the most popular JavaScript library nowadays a developer can learn.

What is react?

The definition in the React website says,

React is a JavaScript library for building user interfaces

It is a JavaScript library. It allows you to build JavaScript driven apps. React apps run in the browser. The apps don’t have to wait for a server response whenever things are happening instantly.

It allows you to create components to build user interfaces. This may be a little new to you because in most instances you may have written your HTML code on the same page. Even if you reuse some code, you still would have wanted to repeat it.

So what’s the react way of creating a webpage? Let’s take an example,

As shown in the above figure 1, you can split up your website into several components. This is only a high-level component breakdown, but it can go deeper, and you can create small component elements. For example list views, navigation components, repeatable content, etc.… That’s the beauty of the React framework. Then you can maintain them separately and create them as building blocks. That way it is easy for the development teams to distribute their work and manage.

Why React?

Some parts of this question have been answered above, but there is more;

  • Easy State management

React helps you to overcome a common problem faced in normal JavaScript which is managing the UI State. In normal JavaScript aka Vanilla JavaScript, you have to target your DOM elements manually. If you change the structure of your HTML, then you would also have to change the way you call the elements, due to using query selectors. Yes, jQuery made accessing DOM easier, but you would still have to keep your attention to it. But when the app becomes more massive it becomes harder to maintain, so react helps you to manage the UI State very easily by allowing you to create highly dynamic components.

  • Allows you to focus on business logic

React is maintained by a vast community. Because of that, the framework code is much better and continues to be refined, so you don’t have to worry about the app’s state and emphasize more on the business logic since there is a lower chance of having your web app to crash due to a framework issue. The better code allows the React framework to be highly efficient and fast.

3. React has a huge ecosystem and extremely active community

You are not alone with using this framework. If you do encounter any problems, it’s straightforward to find a solution for that through the React developers community or using a third party component which can help you.

These are some reasons why react is an excellent framework to consider for your next project.

To view or add a comment, sign in

More articles by Sameera Chathuranga

  • Migrate away from Appcenter

    Microsoft has officially announced that they are going to retire AppCenter from March 31, 2025, onwards. Since a large…

    2 Comments
  • JavaScript — Introduction

    Today JavaScript is one of the most powerful languages in the world. It started as a website scripting language, but…

    2 Comments

Others also viewed

Explore content categories