PLATFORM
  • Tails

    Create websites with TailwindCSS

  • Blocks

    Design blocks for your website

  • Wave

    Start building the next great SAAS

  • Pines

    Alpine & Tailwind UI Library

  • Auth

    Plug'n Play Authentication for Laravel

  • Designer comingsoon

    Create website designs with AI

  • DevBlog comingsoon

    Blog platform for developers

  • Static

    Build a simple static website

  • SaaS Adventure

    21-day program to build a SAAS

DOM Manipulation in React

DOM Manipulation in React

%%[mail]


This React series will cover everything and will take you from beginner to intermediate in React and JavaScript. Latest post regarding DOM Manipulation let's know the process...


DOM Manipulation

DOM Manipulation is the process by which one can dynamically change the content of the web page. Working with DOM should be fairly easy and quick as it is always tree-structured, traversing the DOM is easy.

In React, changes are made to the Virtual DOM and then synced to the React DOM. This process is call Reconciliation. React can figure out which objects have been changed, and this process is called drifting.


Process of DOM manipulation

  • React will update the Virtual DOM
  • The previous state virtual DOM will then be compared with the updated Virtual DOM, to identify what has been changed in the objects. This is done using the Diffing Algorithm.
  • The changed objects will get updated on the Real DOM.

Example of Diffing Algorithm

As the new element is added to the beginning it will be rebuilding the entire list again.


☕Thanks For Reading | Happy Coding🤨

%%[bmc]

Comments (0)

loading comments