React Core Concept

Shihabmilky
3 min readMay 8, 2021

React.js is JavaScript Popular Library isn’t framework. so we can discuss about react core concept. Let’s started.

1.What Is React JS?

React js is popular library in javascript. It used for building user interface. React can be used for single page application.

2.Virtual DOM

React work on virtual dom. react have virtual dom. react copy orginal dom to virtual dom but it have extra power. orginial dom is slow work and when change anything then real dom check everything and then reload but react virtual dom already copy orginal dom and virtual dom when we change it check where we change and it compare real dom and where real dom change virtual dom only change there and reload only where change for this react virtual dom work first and it have extra power. the change algorithm name is reconciliation.

3.Components

one web application have many section. sometime we see many section structure are same. there data is different. in this time we rewrite our code of section by section. but react component are similar in look different in data. when we use react component then we don’t need to rewrite similar code.

4.Props

acutely, React props is an object. already told react component similar in look different. when we need to data pass parent component to child component and this data receive in child component by props and parent component passing value to all time receive an object. props max time use in small web application.

5.Hook

react hook come from react functional components. when we need to some data load then we use useEffect hook. after data this data some where we need to put then we use useState hook. react have other hook useref etc.

6.Context Api

context api is another method pass data. this is use parent to child and also child to parent component . sometime we need child component to parent component then we use context api.

7.JSX

React JSX allow to us write HTML . pure javascript don’t allow write html in file. browser can’t support JSX then browser convert to regular javascript then browser understand what happen .

Note: React allow not full HTML its like HTML. JSX have some change. we declare class in html but JSX we write className

8. State

sometime we need to store data then we use a react hook this name is useState hook. when any data change then we this data set to state. functional component in state declare is very easy and any data set is very very easy.

9.Conditional Render

sometime we need to conditional render. because when a anybody login in web application then we check is user or admin. if user then we see user interface and user futures and user dashboard or is admin then we see admin dashboard and admin futuers.

10. Event handler

in react little different in use event handling. in html we use onclick function but in react we can use camel case onClick function . so it changed in useing event handling

--

--