Fundamental concepts of React.js

Rayhan bepary
Nov 4, 2020

Today we will discuss 5 fundamental concepts of react.js. Let’s start.

  1. JSX in react:

JSX is not HTML but looks like HTML. it’s a syntax extension in javascript. JSX is only used to react to describe what the UI should look like. JSX gives us the power to write HTML in javascript.

2. Props:

Props is a special keyword to react. It has been used to pass data from one component to another. it passes data in a one-directional way, especially parent to child.

3. State:

State is an object of javascript that stores the data of a component. state is dynamic. it gives data to render that shows on the UI.

4. useEffect:

if we use class component in react we get some special features naturally, but if we use functional component we miss theme. But right now we can get theme by using react hook. useEffect is a react hook. it has been used to avoid side-effects.

5. Context API:

Context api is a advanced thing in react for storing data. Basically, we store data in the state of a component and pass data through props. but if we want to work with a large scale of data, then it will be difficult to manage data using state and props. To solve this problem react launch context api. Through context api we can store all data here and can distribute the data to any component easily. context api has three main parts to storing and distributing data.

  • context: the store of data
  • provider: the source of the data
  • consumer: the subscriber/listener for the data

--

--