Master React From Scratch

Clear, practical, and structured React lessons designed for beginners and developers.

COURSE SYLLABUS
1. Introduction to React
Introduction to React What Is React? Features of React Advantages of React Limitations of React Uses of React React vs JavaScript React Architecture
2. React Getting Started
Getting Started Introduction Prerequisites Installing Node.js and npm Creating a React Project with Vite React Project Structure Running React Application Your First React Application
3. JSX
JSX Introduction What Is JSX? JavaScript Expressions JSX Attributes Rendering JSX Elements JSX Children React Fragments JSX Rules and Best Practices JSX vs HTML
4. React Components
Components Introduction Functional Components Class Components Component Composition Reusable Components Component Tree Component Lifecycle Import and Export Components
5. React Props
Props Introduction What Are Props? Passing Props to Components Props Destructuring Default Props Values Children Props Typing Props with TypeScript Props vs State
6. React State
State Introduction What Is State? useState Hook Updating State Functional State Updates State with Objects State with Arrays State Immutability Lifting State Up
7. React Events
Events Introduction Handling Events Passing Arguments to Event Handlers Synthetic Events Form Events Keyboard and Mouse Events Event Propagation
8. Conditional Rendering
Conditional Rendering Introduction If-Else Rendering Ternary Operator Logical AND Operator Element Variables Preventing Rendering Multiple Conditions Conditional CSS Classes
9. Lists and Keys
Lists and Keys Introduction Rendering Lists with map() Understanding Keys Choosing Unique Keys Lists of Objects Filtering Lists Sorting Lists Empty Lists and Conditional Rendering
10. React Forms
Forms Introduction Handling Forms Controlled Components Uncontrolled Components Handling Input Fields Checkboxes and Radio Buttons Select and Textarea Form Validation Form Submission
11. React Hooks
Hooks Introduction useState Hook useEffect Hook Effect Dependencies and Cleanup useRef Hook useReducer Hook useMemo Hook useCallback Hook Custom Hooks Rules of Hooks
12. React Context API
Context API Introduction createContext useContext Context Provider Reading Context Updating Context Using Multiple Contexts Context API vs Props Context API Best Practices
13. React Routing
Routing Introduction Introduction to React Router Installing React Router BrowserRouter Setup Routes and Route Components Link and NavLink Programmatic Navigation URL Parameters and useParams Nested Routes Not Found Routes Protected Routes
14. API Integration
API Integration Introduction Fetch API Async/Await with API Calls Displaying API Data Loading and Error States Sending POST Requests API Error Handling Using Axios Custom Fetch Hook API Environment Variables
15. State Management
State Management Introduction Global State Prop Drilling Introduction to Redux Redux Core Concepts Redux Toolkit Store and Slices useSelector and useDispatch Async Operations with Redux Toolkit State Management Best Practices
16. React Performance
Performance Introduction Understanding Re-Renders Avoiding Unnecessary Re-Renders React.memo useMemo Optimization useCallback Optimization React Developer Tools and Profiler Lazy Loading Components Code Splitting Optimizing Large Lists Performance Best Practices

Component Tree in React

Understand parent-child relationships, component hierarchy and how React components form a tree at CIIT Training Institute.

Beginner Friendly Practical Examples Expected Output Included

01 Learning Objectives

After completing this lesson, you will be able to:

01
Understand Component Trees

Learn how components form a hierarchy.

02
Identify Parent and Child

Understand how one component renders another.

03
Read Nested Components

Follow component relationships in JSX.

04
Organize Application UI

Break a page into manageable components.

02 What Is a Component Tree?

A component tree is a hierarchical representation of how React components are nested inside one another. The root component sits at the top, and the components it renders appear as children.

Remember: If App renders Header and CourseList, those components are children of App in the component tree.
App.jsx JSX
function Header() {
    return <h2>CIIT Training Institute</h2>;
}

function CourseList() {
    return (
        <ul>
            <li>React JS</li>
            <li>.NET Full Stack</li>
        </ul>
    );
}

function App() {
    return (
        <div>
            <Header />
            <CourseList />
        </div>
    );
}

export default App;
Expected Browser Output

CIIT Training Institute

  • React JS
  • .NET Full Stack

03 Component Tree Diagram

This diagram shows the hierarchy of an institute website. The App component contains a Header, MainContent and Footer. MainContent contains the course and student sections.

CIIT TRAINING INSTITUTE — COMPONENT HIERARCHY
ROOT COMPONENT App
CHILD Header
CHILD MainContent
CHILD Footer
CourseSection
StudentSection
Parent components organize children. The tree represents component nesting, not the visual position of every element.

04 Building a Nested Component Tree

Let's create a small course page where App renders CourseSection, and CourseSection renders CourseTitle and CourseDetails.

App.jsx JSX
function CourseTitle() {
    return <h2>React JS Training</h2>;
}

function CourseDetails() {
    return (
        <div>
            <p>Learn JSX and components.</p>
            <p>Build practical projects at CIIT Training Institute.</p>
        </div>
    );
}

function CourseSection() {
    return (
        <section>
            <CourseTitle />
            <CourseDetails />
        </section>
    );
}

function App() {
    return <CourseSection />;
}

export default App;
Expected Browser Output

React JS Training

Learn JSX and components.

Build practical projects at CIIT Training Institute.

05 Student Profiles Component Tree

A parent can render a reusable StudentCard component several times. Each card receives different props, while the component structure stays the same.

StudentCard.jsx JSX
function StudentCard({ name, course }) {
    return (
        <div>
            <h3>{name}</h3>
            <p>Course: {course}</p>
        </div>
    );
}

export default StudentCard;
App.jsx JSX
import StudentCard from "./StudentCard";

function StudentSection() {
    return (
        <section>
            <h2>CIIT Student Profiles</h2>

            <StudentCard
                name="Samadhan"
                course="React JS"
            />

            <StudentCard
                name="Samiksha"
                course=".NET Full Stack"
            />

            <StudentCard
                name="Pradnya"
                course="Python"
            />
        </section>
    );
}

function App() {
    return <StudentSection />;
}

export default App;
Expected Browser Output

CIIT Student Profiles

Samadhan Course: React JS
Samiksha Course: .NET Full Stack
Pradnya Course: Python

06 How to Read a Component Tree

01
Root

The top-level component of the displayed component hierarchy.

02
Parent

A component that renders another component.

03
Child

A component rendered by another component.

04
Sibling Components

Components rendered by the same parent.

07 Important Rules and Best Practices

✓

Break large interfaces into smaller components.

✓

Use meaningful component names such as Header and StudentCard.

✓

Pass data through props when child components need it.

✓

Keep the component hierarchy understandable and maintainable.

✓

Remember that rendering a component creates a component relationship in the tree.

08 Practice Questions

  1. Draw a component tree for a website with Header, MainContent and Footer.
  2. Create a CourseSection component with CourseTitle and CourseDetails.
  3. Build a StudentSection that renders Samadhan, Samiksha and Pradnya.
  4. Explain the difference between a parent and a child component.
  5. Identify the sibling components in the first diagram.
  6. Create a component tree for a simple student dashboard.

Summary

A Component Tree represents the hierarchy formed when React components render other components. The root component sits at the top, parent components render children, and components rendered by the same parent are siblings. Reusable components and props help organize the tree and display different data without repeating the UI structure. At CIIT Training Institute, practise drawing and building component trees for course pages and student profiles.