#1India's Top IT Training Institute

×

About Uncodemy

Know more about who we are and what we stand for.

About Us

About Us

Discover our mission to equip individuals with essential IT skills and industry expertise.

Read More →
UnCodeMy Gallery

UnCodeMy Gallery

Explore highlights from our IT training sessions and success stories.

Read More →
×

Free Resources

Learn, practice and plan your career — bilkul free.

Tutorials

Tutorials

Step-by-step written tutorials to learn any technology at your own pace.

Read More →
Free Counselling

Free Counselling

Book a free video counselling session and pick the right course for you.

Read More →
Online Compiler

Online Compiler

Write, run and test your code online — no setup required.

Read More →

React JS · Beginner Friendly

React JS Basics Explained in Simple Language

React JS explained without the jargon — components, JSX, props, state and hooks in plain English, with real examples beginners can actually understand.

Tracks
React Basics · Live Interactive
Concept
—
What it is
In Plain English
—
How to think about it
Example
—
Real usage
Component → State → Render → UI
Click a tab to see core React concepts explained without jargon.

Home / Tutorials / React JS Guides / React JS Basics Explained in Simple Language

React JS · Beginner Friendly

React JS Basics Explained in Simple Language

ROOT SECTION CARD BUTTON App Top-level component Holds everything Root ProductList Section of items Fetches data Section ProductCard One product Reusable Item AddToCart Button Handles click Action
React apps are trees of components — each smaller piece is reusable and does one job well.

Quick summary — React basics in plain English

React is a JavaScript library for building user interfaces out of small, reusable pieces called components. Each component is a function that returns UI — and React takes care of updating the screen when data changes.

In this guide you will learn:

  1. What a component is — no jargon.
  2. What JSX is — and why it looks like HTML.
  3. Props vs State — the biggest beginner confusion.
  4. Hooks — why they exist and how they help.
  5. Interview Q&A + quiz to test your understanding.

SECTION 01What a component is

A component is just a JavaScript function that returns some HTML. That's it. When React sees a component, it calls the function, gets the HTML back, and renders it to the screen.

// The simplest possible React component
function Welcome() {
  return <h1>Hello, world!</h1>;
}

// Use it like HTML
<Welcome />
components.jsx
Key insight: If you know how to write a JavaScript function that returns HTML, you already know how to write a React component. That's really it.

SECTION 02What JSX is (and why it looks like HTML)

JSX is a syntax that lets you write HTML-like code inside JavaScript. It's not HTML and it's not a string — it's a shorthand that gets compiled to JavaScript function calls.

What you write (JSX) What it compiles to (JS)
<h1>Hello</h1>React.createElement("h1", null, "Hello")
<Greeting name="Ankit" />React.createElement(Greeting, { name: "Ankit" })
<div className="box">...</div>React.createElement("div", { className: "box" }, ...)
// JSX — looks like HTML, but it's JavaScript
function ProductCard({ product }) {
  return (
    <div className="card">
      <h2>{product.name}</h2>
      <p>₹{product.price}</p>
      <button onClick={() => alert(product.name)}>
        Buy now
      </button>
    </div>
  );
}
jsx-example.jsx
Key insight: JSX is just a shortcut. You could write React without it (using React.createElement), but nobody does because JSX is so much easier to read.

SECTION 03Props vs State — the difference

This is the most common beginner confusion. The simple difference:

  • Props — data passed into a component from the parent. Read-only. Like arguments to a function.
  • State — data owned by a component that can change over time. It's what makes the UI reactive.
Aspect Props State
Who controls itParent componentThe component itself
Can it change?No — read-onlyYes — via setState / useState
AnalogyFunction parametersLocal variable that triggers re-render
Where it's usedConfig, data passed inUser input, toggle, counters, fetched data
Triggers re-render?Yes (if parent passes new values)Yes (when you call the setter)
// Props — data from parent, read-only
function Greeting({ name }) {
  return <h1>Hello, {name}!</h1>;
}

// Parent passes props
<Greeting name="Ankit" />
<Greeting name="Priya" />
props-vs-state.jsx
Key insight: Props go in, state lives here. If a component needs to change data over time, it uses state. If it receives data from its parent, it uses props.

SECTION 04Hooks — why they exist

Hooks are functions that let you "hook into" React features from a function component. Before hooks (pre-2019), you had to write class components to use state or lifecycle methods. Hooks made everything simpler.

Hook What it does Common use
useStateAdds local state to a function componentCounters, forms, toggles
useEffectRuns side effects (fetch, timers)Data fetching, subscriptions
useContextAccess shared values without prop drillingThemes, auth state
useRefHold a mutable reference between rendersDOM refs, timers
useMemoMemoise expensive computationsSorting large lists
useCallbackMemoise function referencesPreventing re-renders
import { useState } from "react";

function Toggle() {
  const [isOn, setIsOn] = useState(false);

  return (
    <button onClick={() => setIsOn(!isOn)}>
      {isOn ? "ON" : "OFF"}
    </button>
  );
}
hooks.jsx
Key insight: You'll use useState and useEffect in 90% of components. Learn those two first and you can build real apps.

SECTION 05Common beginner mistakes

  • Trying to modify props — props are read-only; pass a setter function instead.
  • Forgetting key in lists — always add a stable key when rendering arrays.
  • Missing dependencies in useEffect — always include everything the effect uses in the array.
  • Using class components first — start with function components and hooks; class is legacy.
  • Overusing state — if a value can be computed from state, don't store it in state.
  • Not using TypeScript — even for beginners, TypeScript catches more bugs than you'd expect.

SECTION 06Interview Q&A — React basics

Q1What's the difference between props and state?

Props are data passed from parent to child — read-only. State is data owned by a component that can change over time. Props are like function arguments; state is like a local variable that triggers re-renders when it changes.

Q2What is JSX?

JSX is a syntax extension that lets you write HTML-like code in JavaScript. Under the hood, JSX compiles to React.createElement() calls. It's not HTML and it's not a string — it's a shorthand React understands.

Q3Why do we use useState instead of a regular variable?

A regular variable doesn't trigger a re-render when it changes. useState tells React "this value matters — re-render when it changes." That's what makes the UI reactive.

Q4What does useEffect do?

It runs side effects after the component renders — like fetching data, setting timers, or subscribing to events. The dependency array controls when it runs: [] means run once, missing array means run every render, and [dep] means run when dep changes.

Q5What's a component?

A component is a JavaScript function that returns JSX. It's the fundamental building block of React apps. Components can be composed — smaller ones combine into larger ones, forming a tree.

SECTION 07Test yourself — React basics quiz

Five questions. No sign-up.

0 / 5

Pick an answer to see why it is right or wrong.

SECTION 08Frequently asked questions

Do I need to know JavaScript before React?

Yes. You need to be comfortable with functions, arrays, objects, destructuring, map/filter, and arrow functions. About 3–4 weeks of JavaScript is enough to start React.

Should I learn class components or function components?

Function components + hooks. Class components are legacy — new React code almost never uses them. Focus on function components and useState/useEffect.

What's the difference between React and Next.js?

React is a UI library. Next.js is a framework built on React that adds routing, server-side rendering, and API routes. Learn React first; Next.js later if you want server-side features.

How long does it take to learn React basics?

With solid JavaScript, 2–3 weeks to learn the basics (components, props, state, hooks), and another 2–4 weeks to be comfortable with real projects. Most people take 6–8 weeks to build something they're proud of.

Should I learn React or Vue or Angular?

React has the largest job market and the broadest ecosystem. Vue is easier for beginners. Angular is strong in enterprise. For most people starting fresh in 2026, React is the safest bet — more jobs, more community, more resources.

Classroom & online · Noida

Learn React from scratch

Our React JS Frontend Programme covers JavaScript, React basics, hooks, routing, and real projects — with interview prep and placement support.

₹15,500 · full programme ₹24,000
  • React + hooks + routing
  • Real frontend projects
  • Interview prep
  • Weekday & weekend batches