Member-only story

Learn React Components for Your Next React or React Native Project.

Learning the basics for React and React Native

Nitin Sharma
5 min readFeb 15, 2021
Photo by Siora Photography on Unsplash

I love Components, and you are also going to love them.

What are Components?

Components are reusable code that we can write once and access multiple times inside our project.

It works efficiently so that you don’t have to be tensed. In React, components play a vital role. Most programmers use hundreds of components to write code efficiently and use it.

Components are mainly of two types:

  1. Functional Component.
  2. Class Component.

Let Us Understand Functional Component

A Functional component is a simple function that gets called to return its value.

Many of you use a function, why? It makes code simpler.

So you can think of Component a bit similar to functions.

For example:

function Name() {
return <h2>Hello, I am Nitin!</h2>;
}

It is a Functional Component.

Isn’t it easy? Guys, React.js is simple, easy, and powerful.

--

--

No responses yet