<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Bismay.exe</title>
    <description>The latest articles on DEV Community by Bismay.exe (@bismay-exe).</description>
    <link>https://dev.to/bismay-exe</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3452916%2F8a7358f9-907d-4c26-82f6-60361cf383c4.png</url>
      <title>DEV Community: Bismay.exe</title>
      <link>https://dev.to/bismay-exe</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/bismay-exe"/>
    <language>en</language>
    <item>
      <title>🚀 Day 1 of Learning React: Why React Exists, the Real DOM, Virtual DOM &amp; React Elements</title>
      <dc:creator>Bismay.exe</dc:creator>
      <pubDate>Mon, 22 Jun 2026 19:28:37 +0000</pubDate>
      <link>https://dev.to/bismay-exe/day-1-of-learning-react-why-react-exists-the-real-dom-virtual-dom-react-elements-5b61</link>
      <guid>https://dev.to/bismay-exe/day-1-of-learning-react-why-react-exists-the-real-dom-virtual-dom-react-elements-5b61</guid>
      <description>&lt;p&gt;Today marks &lt;strong&gt;Day 1&lt;/strong&gt; of my React journey.&lt;/p&gt;

&lt;p&gt;I've decided to document everything I learn—not because I'm an expert, but because I believe sharing the learning process can help other beginners while also helping me understand concepts better.&lt;/p&gt;

&lt;p&gt;Today's goal wasn't to build an app.&lt;/p&gt;

&lt;p&gt;It was to answer one simple question:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Why was React created in the first place? 🤔&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Let's dive in.&lt;/p&gt;




&lt;h2&gt;
  
  
  💡 Why Was React Created?
&lt;/h2&gt;

&lt;p&gt;Before React existed, developers built interactive websites by directly manipulating the browser's DOM using JavaScript or jQuery.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;heading&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;h1&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;heading&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;textContent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Hello World&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This works perfectly for small applications.&lt;/p&gt;

&lt;p&gt;But imagine building something like Facebook.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;📰 News Feed&lt;/li&gt;
&lt;li&gt;💬 Messages&lt;/li&gt;
&lt;li&gt;❤️ Likes&lt;/li&gt;
&lt;li&gt;🔔 Notifications&lt;/li&gt;
&lt;li&gt;💭 Comments&lt;/li&gt;
&lt;li&gt;👥 Friends List&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each part of the page can update independently.&lt;/p&gt;

&lt;p&gt;As applications grow larger, manually deciding:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Which DOM node should update&lt;/li&gt;
&lt;li&gt;When it should update&lt;/li&gt;
&lt;li&gt;What else depends on it&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;becomes increasingly difficult.&lt;/p&gt;

&lt;p&gt;That's where React changed everything.&lt;/p&gt;

&lt;p&gt;Instead of manually updating the UI, React introduced a much simpler idea:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;UI = Function(State)&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;You describe &lt;strong&gt;what the UI should look like&lt;/strong&gt;, and React figures out &lt;strong&gt;how to efficiently update the browser.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I think that's a really elegant way to think about building user interfaces.&lt;/p&gt;




&lt;h2&gt;
  
  
  🌳 What Is the Real DOM?
&lt;/h2&gt;

&lt;p&gt;When the browser reads your HTML, it creates a tree-like structure called the &lt;strong&gt;Document Object Model (DOM).&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;main&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;Hello&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/main&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The browser sees something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Document
└── body
    └── main
        └── h1
            └── Hello
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is called the &lt;strong&gt;Real DOM&lt;/strong&gt; because it's managed directly by the browser.&lt;/p&gt;

&lt;p&gt;Whenever something changes, the browser may need to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;📐 Recalculate layouts&lt;/li&gt;
&lt;li&gt;🎨 Repaint elements&lt;/li&gt;
&lt;li&gt;🖥️ Update the screen&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These operations become expensive in large applications.&lt;/p&gt;




&lt;h2&gt;
  
  
  ⚛️ What Is a React Element?
&lt;/h2&gt;

&lt;p&gt;One thing that surprised me today was learning that React doesn't immediately create HTML elements.&lt;/p&gt;

&lt;p&gt;When we write:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;element&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createElement&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;h1&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;{},&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Hello React&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;React actually creates a plain JavaScript object like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;h1&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;children&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Hello React&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This object is called a &lt;strong&gt;React Element&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;A React Element is simply a &lt;strong&gt;description of what the UI should look like.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It isn't a real DOM node.&lt;/p&gt;

&lt;p&gt;That small distinction helped me understand React much better.&lt;/p&gt;




&lt;h2&gt;
  
  
  🧠 What Is the Virtual DOM?
&lt;/h2&gt;

&lt;p&gt;The &lt;strong&gt;Virtual DOM&lt;/strong&gt; is another concept I finally understood today.&lt;/p&gt;

&lt;p&gt;It's basically a JavaScript representation of the UI that lives entirely in memory.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;Hello&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;World&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;React internally represents it as something similar to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;div&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;children&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;h1&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;children&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Hello&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;p&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;children&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;World&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The important thing I learned is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;The Virtual DOM doesn't exist inside the browser. It only exists in JavaScript memory.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;React compares changes in this virtual representation and updates only the parts of the Real DOM that actually changed.&lt;/p&gt;

&lt;p&gt;That's one of the reasons React applications stay efficient.&lt;/p&gt;




&lt;h2&gt;
  
  
  🎯 What Happens During the First Render?
&lt;/h2&gt;

&lt;p&gt;When React renders an application for the first time:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;root&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;ReactDOM&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createRoot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;main&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nx"&gt;root&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;render&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createElement&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;h1&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;{},&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Hello React&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
  &lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The process looks something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;React Element
      ↓
Virtual DOM
      ↓
Real DOM
      ↓
Browser Screen
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;React creates the necessary DOM nodes and finally displays them in the browser.&lt;/p&gt;




&lt;h2&gt;
  
  
  ✨ My Biggest Takeaway Today
&lt;/h2&gt;

&lt;p&gt;Today's lesson completely changed how I thought about React.&lt;/p&gt;

&lt;p&gt;Before today I assumed React was simply another JavaScript library.&lt;/p&gt;

&lt;p&gt;Now I realize it's actually &lt;strong&gt;a different way of thinking about building user interfaces.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Instead of telling the browser &lt;em&gt;how&lt;/em&gt; to update every single element...&lt;/p&gt;

&lt;p&gt;React lets us describe &lt;em&gt;what&lt;/em&gt; we want the UI to look like.&lt;/p&gt;

&lt;p&gt;That shift in mindset is what makes React so powerful.&lt;/p&gt;




&lt;h2&gt;
  
  
  📚 What I'm Learning Next
&lt;/h2&gt;

&lt;p&gt;Today's lesson covered:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;✅ Why React?&lt;/li&gt;
&lt;li&gt;✅ Problems React Solves&lt;/li&gt;
&lt;li&gt;✅ History of React&lt;/li&gt;
&lt;li&gt;✅ SPA vs MPA&lt;/li&gt;
&lt;li&gt;✅ React Elements&lt;/li&gt;
&lt;li&gt;✅ ReactDOM&lt;/li&gt;
&lt;li&gt;✅ Virtual DOM&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Tomorrow I'll continue with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🔄 Reconciliation&lt;/li&gt;
&lt;li&gt;⚡ Diffing Algorithm&lt;/li&gt;
&lt;li&gt;🎨 Render Phase&lt;/li&gt;
&lt;li&gt;✅ Commit Phase&lt;/li&gt;
&lt;li&gt;🧵 React Fiber Architecture&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I'll continue documenting everything I learn as I go. 🚀&lt;/p&gt;




&lt;h2&gt;
  
  
  📖 Learning Source
&lt;/h2&gt;

&lt;p&gt;I'm currently learning React through the React course by &lt;strong&gt;Devendra Dhote&lt;/strong&gt; at &lt;strong&gt;Sheriyans Coding School&lt;/strong&gt;. These posts are my own notes and understanding of each day's lessons, written in my own words as I continue learning.&lt;/p&gt;

&lt;p&gt;If I misunderstand any concept, feel free to correct me in the comments—I'm here to learn. 😊&lt;/p&gt;




&lt;h2&gt;
  
  
  🙌 Final Thoughts
&lt;/h2&gt;

&lt;p&gt;This is only &lt;strong&gt;Day 1&lt;/strong&gt;, but I'm already enjoying the journey.&lt;/p&gt;

&lt;p&gt;I'm sure there will be confusing concepts, bugs, and plenty of mistakes along the way—but that's part of learning.&lt;/p&gt;

&lt;p&gt;If you're also starting React from scratch, let's learn together.&lt;/p&gt;

&lt;p&gt;See you in &lt;strong&gt;Day 2! 🚀&lt;/strong&gt;&lt;/p&gt;




&lt;p&gt;💬 &lt;strong&gt;What was the hardest React concept for you when you started?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I'd love to hear your experience in the comments. 😊&lt;/p&gt;

&lt;p&gt;If you're also learning React, consider following along—I'll be sharing what I learn every day. You can also find me on &lt;a href="https://github.com/Bismay-exe" rel="noopener noreferrer"&gt;&lt;strong&gt;GitHub&lt;/strong&gt;&lt;/a&gt;, where I'll be sharing my projects and documenting my progress.&lt;/p&gt;

&lt;p&gt;Thanks for reading! 🚀&lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
    <item>
      <title>My First Post</title>
      <dc:creator>Bismay.exe</dc:creator>
      <pubDate>Fri, 22 Aug 2025 15:01:29 +0000</pubDate>
      <link>https://dev.to/bismay-exe/my-first-post-3oon</link>
      <guid>https://dev.to/bismay-exe/my-first-post-3oon</guid>
      <description>&lt;blockquote&gt;
&lt;/blockquote&gt;

</description>
    </item>
  </channel>
</rss>
