<?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: Jamir Khan</title>
    <description>The latest articles on DEV Community by Jamir Khan (@jamir_khan_81139708882eb8).</description>
    <link>https://dev.to/jamir_khan_81139708882eb8</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3724630%2F24677136-dd54-4e59-b93e-1a51b282da09.jpg</url>
      <title>DEV Community: Jamir Khan</title>
      <link>https://dev.to/jamir_khan_81139708882eb8</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jamir_khan_81139708882eb8"/>
    <language>en</language>
    <item>
      <title>Understanding JSX &amp; How a React App Starts (Beginner-Friendly Guide)</title>
      <dc:creator>Jamir Khan</dc:creator>
      <pubDate>Thu, 22 Jan 2026 06:22:15 +0000</pubDate>
      <link>https://dev.to/jamir_khan_81139708882eb8/understanding-jsx-how-a-react-app-starts-beginner-friendly-guide-107p</link>
      <guid>https://dev.to/jamir_khan_81139708882eb8/understanding-jsx-how-a-react-app-starts-beginner-friendly-guide-107p</guid>
      <description>&lt;p&gt;If you’re just starting with React, you might be wondering:&lt;br&gt;
Where does a React app actually start, and what is JSX really doing behind the scenes?&lt;/p&gt;

&lt;p&gt;In this article, I’ll break it down step by step, using a simple Vite-based React app—exactly the way I explain it in my latest YouTube video.&lt;/p&gt;

&lt;p&gt;👉 Watch the full video here:&lt;br&gt;
&lt;a href="https://youtu.be/31W0nJ2yXg8" rel="noopener noreferrer"&gt;https://youtu.be/31W0nJ2yXg8&lt;/a&gt;&lt;/p&gt;


&lt;h3&gt;
  
  
  Prerequisite: Node.js
&lt;/h3&gt;

&lt;p&gt;Before running any React project Node.js must be installed on your system.&lt;/p&gt;

&lt;p&gt;You can quickly check by running:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node -v
npm -v
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If both commands show version numbers, you’re good to go 👍&lt;/p&gt;

&lt;p&gt;If not:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Visit nodejs.org&lt;/li&gt;
&lt;li&gt;Download the &lt;strong&gt;LTS version&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Install it (just keep clicking &lt;strong&gt;Next&lt;/strong&gt;)&lt;/li&gt;
&lt;li&gt;npm gets installed automatically with Node&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  Understanding the Basic Structure of a React App
&lt;/h3&gt;

&lt;p&gt;Let’s start by understanding &lt;strong&gt;how a React app actually runs&lt;/strong&gt;.&lt;/p&gt;

&lt;h4&gt;
  
  
  1. &lt;strong&gt;index.html&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Open the &lt;code&gt;index.html&lt;/code&gt; file and notice two important things:&lt;/p&gt;

&lt;p&gt;A &lt;code&gt;&amp;lt;div id="root"&amp;gt;&amp;lt;/div&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;main.jsx&lt;/code&gt; file linked at the bottom&lt;/p&gt;

&lt;p&gt;This root div is where your entire React app gets rendered.&lt;/p&gt;

&lt;h4&gt;
  
  
  2. &lt;strong&gt;main.jsx — The Entry Point&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Now open &lt;code&gt;src/main.jsx&lt;/code&gt;.&lt;br&gt;
You’ll see React’s &lt;code&gt;createRoot&lt;/code&gt; function:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;createRoot(document.getElementById('root')).render(
  &amp;lt;StrictMode&amp;gt;
    &amp;lt;App /&amp;gt;
  &amp;lt;/StrictMode&amp;gt;
);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What’s happening here?&lt;br&gt;
React creates a &lt;strong&gt;root node&lt;/strong&gt;&lt;br&gt;
It takes the &lt;code&gt;root&lt;/code&gt; element from &lt;code&gt;index.html&lt;/code&gt;&lt;br&gt;
It renders the &lt;code&gt;App&lt;/code&gt; component inside it&lt;/p&gt;

&lt;p&gt;This is the &lt;strong&gt;starting point of every React app&lt;/strong&gt;.&lt;/p&gt;


&lt;h3&gt;
  
  
  JSX
&lt;/h3&gt;

&lt;p&gt;Now let’s talk about the most important concept in React: &lt;strong&gt;JSX&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is JSX?&lt;/strong&gt;&lt;br&gt;
Normally, when using JavaScript, creating HTML requires:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;createElement&lt;/li&gt;
&lt;li&gt;appendChild&lt;/li&gt;
&lt;li&gt;innerHTML&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But React simplifies all of this using JSX.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const element = &amp;lt;h1&amp;gt;I love JSX!!!&amp;lt;/h1&amp;gt;;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Important: JSX is NOT HTML
&lt;/h4&gt;

&lt;p&gt;Browsers do &lt;strong&gt;not understand JSX&lt;/strong&gt;.&lt;br&gt;
During the build process a transpiler like Babel converts JSX into plain JavaScript&lt;/p&gt;

&lt;p&gt;Behind the scenes, JSX becomes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;React.createElement('h1', {}, 'I love JSX!!!');
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;React then uses this to create actual DOM elements.&lt;/p&gt;




&lt;h3&gt;
  
  
  JavaScript Expressions Inside JSX
&lt;/h3&gt;

&lt;p&gt;One of JSX’s most powerful features is the ability to write JavaScript expressions inside {}.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const age = 25;
&amp;lt;p&amp;gt;Age next year: {age + 1}&amp;lt;/p&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Age next year: 26
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can also render variables dynamically:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const title = "Daily Improvements";
&amp;lt;h1&amp;gt;{title}&amp;lt;/h1&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is what makes React UI dynamic and powerful.&lt;/p&gt;

&lt;h3&gt;
  
  
  JSX Rule: className Instead of class
&lt;/h3&gt;

&lt;p&gt;In HTML, we write:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class="text-red"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But in JSX, we use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;className="text-red"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Why?&lt;br&gt;
Because &lt;code&gt;class&lt;/code&gt; is a &lt;strong&gt;reserved keyword in JavaScript&lt;/strong&gt;.&lt;/p&gt;


&lt;h3&gt;
  
  
  What Is a React Component?
&lt;/h3&gt;

&lt;p&gt;A React component is simply a &lt;strong&gt;JavaScript function&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Two rules:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The function name must start with a capital letter&lt;/li&gt;
&lt;li&gt;It must return something renderable (usually JSX)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function Header() {
  return &amp;lt;h1&amp;gt;Hello React&amp;lt;/h1&amp;gt;;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Why Components Matter?
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Reusability&lt;/li&gt;
&lt;li&gt;Clean code&lt;/li&gt;
&lt;li&gt;Easy maintenance&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can reuse the same component multiple times across your app.&lt;/p&gt;




&lt;h3&gt;
  
  
  Watch the Full Explanation
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;YouTube Video&lt;/strong&gt;:&lt;br&gt;
&lt;a href="https://youtu.be/31W0nJ2yXg8" rel="noopener noreferrer"&gt;https://youtu.be/31W0nJ2yXg8&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If this helped you:&lt;br&gt;
👍 Like the video&lt;br&gt;
🔔 Subscribe to Project Station&lt;br&gt;
💬 Leave a comment with your questions&lt;/p&gt;

&lt;p&gt;Thanks for reading — happy coding.&lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>jsx</category>
      <category>frontend</category>
    </item>
  </channel>
</rss>
