In this article, we will learn what is reactjs, why we should use react, and why reactJs is declarative. Also, we will be going through the prerequisites to create the reactjs application. 

 We will be covering the following topics in this article,

Contents

  • What is react js?
  • Why should I learn Reactjs?
  • What is component-based architecture?
  • How can we write reusable code?
  • Why React js is declarative?
  • What are Prerequisites?
  • Summary

 What is react js?

ReactJS is an open-source library that is related to JavaScript for building interactive and rich interfaces, there are two key points in this definition.

1.  ReactJS is a JavaScript library it is not a framework, it is a library which is focused on doing one thing and doing that one thing really well.

2.  Building user interfaces so react does not focus on the other aspects of your application, like routing or HTTP requests. ReactJs is responsible only for building front-end applications which you can see in the browser.  

But, how reactjs would handle routing, HTTP requests, and other functionality. You don't have to worry about it.  ReactJs has a rich ecosystem and plays really well with other libraries and is more than capable of building full-fledged web applications 


Why should I learn Reactjs?

Let's see why you might want to learn to reactJS.  Let's start with the fact that,  reactJS is a project created and maintained by Facebook.  When a company like Facebook uses react in its own products and invests money and resources to keep the project alive.  You can rest assured it is not going to die down anytime soon.  as of now, it has more than a hundred thousand stars on GitHub and a huge community behind it.

This means to say you will be able to find tons of articles and Stack Overflow solutions to most of the problems, that you will encounter when getting started with react. Also, if you read through the Stack Overflow developer survey every year you will quickly find out that react has become increasingly popular among developers. And it is also,  one of the most sought out skillsets by companies right now.

 Let's learn to react js and have a great chance of landing that front-end developer job. 


What is component-based architecture?

React js has a component-based architecture, which means that it will break down your application into small encapsulated parts, which can then be composed to make more complex UIs.

For instance, a traditional website can be broken down into header, side nav, main content, and footer each section represents a component which when composed in the right way to design the entire website



How can we write reusable code?

It is easy to write reusable code with Components based architecture, for example, you could have the component for an article on react js, the same component can be reused for articles on angular or view by simply passing the right data into the article component. For enterprise applications, the ability to reuse code is a huge plus point 



Why React js is declarative?

Another key point, is that react js is a declarative now, what does that mean?  

Well basically we just have to tell what we want,  and then react js works with its react Dom library and then it will build the actual UI.  This is the declarative paradigm.  Now this is in contrast with the imperative paradigm we are usually used to which implements algorithms in explicit steps

Let me give you a relatable example, let's say you go to an artist and ask them to draw a landscape.  You don't need to tell them how to draw, it's up to them,  this is called declarative.  You tell what has to be done and the artist will get it done for you.

Now the same task you ask a five-year-old child but this time,  you tell them to first draw the mountains, and then the river, and then the trees, and so on.   In this case, you explicitly specified each step and you control the flow of the landscape that is an imperative paradigm.

Why this is so important to understand is because react is declarative you have to tell react js,  How the UI should look like, and react js will create the actual UI.

React js will make it painless for you, to create complex UI s by abstracting away the difficult parts react js will handle efficiently updating and rendering just the right components in your application when your data changes Dom updates which is one of the more expensive operations is handled gracefully in react js. 

React js will not make any assumptions about the rest of the technology stack, you are using for your project.  You can seamlessly integrate react js into any of your applications be it just a portion of the page or a complete page, or even an entire application itself react will fit right in, and once you have a good grasp on react js.  you can also enter the world of mobile applications with react native the bottom line is that react will be a great addition to your skillset now.


What are Prerequisites?

To get started with react js HTML, CSS, and JavaScript fundamentals are absolutely necessary.

Knowledge of modern JavaScript is also essential.  You don't have to be an expert by any means but there are a few features that make it so much easier to write rewrite code. That is why I have recommended learning to react js with es6. 

With JavaScript make sure you're aware of this keyword, filter, map, and reduce methods mainly the map method with es6.

Please go through let and const declarations, arrow functions, template literals, default parameters, object literals rest and spread operators, and finally the structuring assignment.


Summary

To summarise, We have learned what is react js and why should we use react js for building rich user interfaces.

We also learned, what is component-based architecture and how component-based architecture will help reactjs to improve the performance.

We also learned, why they called react js is declarative. Also, prerequisites help to learn reactjs easily.


Back to homepage