DEV Community

AditiJ
AditiJ

Posted on

React Components In Theory

Development

React development was led by Jordan Walke who is a software engineer at Facebook. React was first deployed in 2011.
Now it has become super famous and a lot of contributions have been made globally.

Introduction

React is a JavaScript library used for building fast and interactive user interfaces.

The heart and soul of every React-based Application are Components.

Components

A Component in plain words, is just like a building block. We take a bunch of isolated code blocks and fit them together to form a large scale application.

We can also visualize a React App as a tree of Components.
Taking Twitter for Example We can split the home page into independent components. The App becomes the Root component or the parent component which contains all the other components as its child components.
React Twitter tree component example

Here in this example, we see how a large app like Twitter can be made manageable with the help of components.
Components allow us to make use of reusability in our apps thus increasing code readability and code management.
For instance: The Tweet button can be used across the Twitter application for different purposes with a different look and feel!

Let's take another example We can split the home page of a website into independent components like:

  • SearchBar
  • SideBar
  • NavBar
  • Card Website component example

Conclusion

The component-based design in React increases the efficiency to write code and makes it easier to follow and learn. The components also provide their own logic and a layer of separation in general so that one can add and update logic without causing a lot of issues.

Discussion (0)