React

Md. Shofiullah
2 min readMay 15, 2021

React: React is a javascript library. it’s not a framework. library work is import files in a js project. it can modify the need for developers. it can use any type of project but the framework has some rules, these rules must flow developer to developed use a framework for a project. React follows the Unix philosophy because it is a small library that works extremely well and building a user interface.

virtual DOM can understand which position changes there and which element should change there. virtual dom use for enhancing developer experience. its uses for better performance its not relevant. virtual dom rendering specific element change in UI.

JSX stands for JavaScript XML, JSX makes it easier to write and add HTML in react. it can use HTML tag in javascript code. React embraces the fact that rendering logic is inherently coupled with other UI logic: how events are handled, how the state changes over time, and how the data is prepared for display.

Default Props are used three-way in react first of all use || or symble use pass props default second option use case to method props .defaulatProps method. the third use case for set parameters name and value.

The state is the static components with static data passed down the components tree. it's needed for the stateful component where the state is changing. when data will be change then we declare state hooks useState.

React component life cycle has there high-level parts:

  1. Mounting: when the component is being initialized and put in the dom for the first time.
  2. Updating: when the component updates then change the state or change the props.
  3. Unmounting: when the component is being From the Document object model.

Why Hooks: Hooks are functions that let us state and lifecycle functionality in function components. reuse stateful logic between components. simplify and organize our code to separate concerns, rather than allowing unrelated data to get tangled up together. avoid confusion around the behavior of the this keyword. avoid class constructors, binding methods, and related advanced JavaScript techniques.

--

--