惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Microsoft Security Blog
Microsoft Security Blog
Apple Machine Learning Research
Apple Machine Learning Research
美团技术团队
WordPress大学
WordPress大学
酷 壳 – CoolShell
酷 壳 – CoolShell
G
Google Developers Blog
阮一峰的网络日志
阮一峰的网络日志
The Cloudflare Blog
J
Java Code Geeks
Martin Fowler
Martin Fowler
M
MIT News - Artificial intelligence
IT之家
IT之家
博客园 - 三生石上(FineUI控件)
月光博客
月光博客
Google DeepMind News
Google DeepMind News
小众软件
小众软件
V
V2EX
Hugging Face - Blog
Hugging Face - Blog
爱范儿
爱范儿
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Jina AI
Jina AI
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
腾讯CDC
B
Blog

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
🚀 Day 1 of Learning React: Why React Exists, the Real DOM...
Bismay.exe · 2026-06-23 · via DEV Community

Today marks Day 1 of my React journey.

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.

Today's goal wasn't to build an app.

It was to answer one simple question:

Why was React created in the first place? 🤔

Let's dive in.


💡 Why Was React Created?

Before React existed, developers built interactive websites by directly manipulating the browser's DOM using JavaScript or jQuery.

For example:

const heading = document.querySelector("h1");
heading.textContent = "Hello World";

This works perfectly for small applications.

But imagine building something like Facebook.

  • 📰 News Feed
  • 💬 Messages
  • ❤️ Likes
  • 🔔 Notifications
  • 💭 Comments
  • 👥 Friends List

Each part of the page can update independently.

As applications grow larger, manually deciding:

  • Which DOM node should update
  • When it should update
  • What else depends on it

becomes increasingly difficult.

That's where React changed everything.

Instead of manually updating the UI, React introduced a much simpler idea:

UI = Function(State)

You describe what the UI should look like, and React figures out how to efficiently update the browser.

I think that's a really elegant way to think about building user interfaces.


🌳 What Is the Real DOM?

When the browser reads your HTML, it creates a tree-like structure called the Document Object Model (DOM).

For example:

<body>
  <main>
    <h1>Hello</h1>
  </main>
</body>

The browser sees something like this:

Document
└── body
    └── main
        └── h1
            └── Hello

This is called the Real DOM because it's managed directly by the browser.

Whenever something changes, the browser may need to:

  • 📐 Recalculate layouts
  • 🎨 Repaint elements
  • 🖥️ Update the screen

These operations become expensive in large applications.


⚛️ What Is a React Element?

One thing that surprised me today was learning that React doesn't immediately create HTML elements.

When we write:

const element = React.createElement(
  "h1",
  {},
  "Hello React"
);

React actually creates a plain JavaScript object like this:

{
  type: "h1",
  props: {
    children: "Hello React"
  }
}

This object is called a React Element.

A React Element is simply a description of what the UI should look like.

It isn't a real DOM node.

That small distinction helped me understand React much better.


🧠 What Is the Virtual DOM?

The Virtual DOM is another concept I finally understood today.

It's basically a JavaScript representation of the UI that lives entirely in memory.

For example:

<div>
  <h1>Hello</h1>
  <p>World</p>
</div>

React internally represents it as something similar to:

{
  type: "div",
  children: [
    {
      type: "h1",
      children: ["Hello"]
    },
    {
      type: "p",
      children: ["World"]
    }
  ]
}

The important thing I learned is:

The Virtual DOM doesn't exist inside the browser. It only exists in JavaScript memory.

React compares changes in this virtual representation and updates only the parts of the Real DOM that actually changed.

That's one of the reasons React applications stay efficient.


🎯 What Happens During the First Render?

When React renders an application for the first time:

const root = ReactDOM.createRoot(
  document.querySelector("main")
);

root.render(
  React.createElement(
    "h1",
    {},
    "Hello React"
  )
);

The process looks something like this:

React Element
      ↓
Virtual DOM
      ↓
Real DOM
      ↓
Browser Screen

React creates the necessary DOM nodes and finally displays them in the browser.


✨ My Biggest Takeaway Today

Today's lesson completely changed how I thought about React.

Before today I assumed React was simply another JavaScript library.

Now I realize it's actually a different way of thinking about building user interfaces.

Instead of telling the browser how to update every single element...

React lets us describe what we want the UI to look like.

That shift in mindset is what makes React so powerful.


📚 What I'm Learning Next

Tomorrow I'm planning to learn:

  • ⚛️ Components
  • 🧩 JSX
  • 📦 Props

I'll continue documenting everything I learn as I go.


📖 Learning Source

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

If I misunderstand any concept, feel free to correct me in the comments—I'm here to learn. 😊


🙌 Final Thoughts

This is only Day 1, but I'm already enjoying the journey.

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

If you're also starting React from scratch, let's learn together.

See you in Day 2! 🚀


💬 What was the hardest React concept for you when you started?

I'd love to hear your experience in the comments. 😊

If you're also learning React, consider following along—I'll be sharing what I learn every day. You can also find me on GitHub, where I'll be sharing my projects and documenting my progress.

Thanks for reading! 🚀