Skip to main content



Understanding React Components

A component can be said to be a piece or an element of a larger object. Think of a car. It is made up of an engine, ignition, tires, doors, etc. These different parts of a car can be regarded as components which makes up the object known as a car.

In getting to build web applications with React, we will often make use of components.

What are Components in React?

Components in React are primarily separate, reusable, independent pieces of code used in building User Interfaces (UIs). To get a clearer picture of components in React, think of functions in JavaScript. What do functions do? They are block of codes that perform specific tasks. Functions can take in arguments, perform evaluation on these arguments and return an output when the function is called.

React Components likewise take in arguments which can be the JSX attributes. These attributes are objects and are known as props. They arereturned as React elements.

Creating Components

React Components are defined like JavaScript func…

Latest Posts

Understanding The Mystery Of JSX And It's Relevance To React

Hello World - Welcome to Charlie Codes