Mahamudul Hasan Rubel
HomeAboutProjectsSkillsExperienceBlogCoursesPhotosContact
Mahamudul Hasan Rubel

Senior Software Engineer crafting high-performance web applications and SaaS platforms.

Navigation

  • Home
  • About
  • Projects
  • Skills
  • Experience
  • Blog
  • Courses
  • Photos
  • Contact

Get in Touch

Available for senior/lead roles and consulting.

bd.mhrubel@gmail.comHire Me

© 2026 Mahamudul Hasan Rubel. All rights reserved.

Built with using Next.js 16 & Tailwind v4

Back to Blog
Lesson 1 of the React Fundamentals: Build Modern UIs from Scratch course
ReactJune 24, 20264 min read

Introduction to Component-Based Architecture in React

Master React architecture by learning to think in components. Discover the power of declarative UI and how to break complex interfaces into reusable pieces.

Reactarchitecturecomponentsdeclarativeweb-developmentjavascriptfrontend

Welcome to the start of your journey into modern web development. In this course, we are going to build a professional-grade movie-browser application. Before we write a single line of code, we need to understand the philosophy that makes React the industry standard: React architecture.

To build scalable applications, we must move away from how we've traditionally written web pages and embrace a component-based mindset.

Declarative vs. Imperative Programming

To understand why React works the way it does, we first need to look at how we used to build the web.

In traditional "imperative" programming, you tell the browser how to change the UI step-by-step. Imagine you have a button that updates a movie title. In an imperative world (using vanilla JavaScript), you would write:

  1. Select the DOM element by ID.
  2. Update the textContent property of that element.
  3. Add a CSS class to change its color.
  4. If the user clicks again, manually revert those changes.

This is brittle. As your app grows, keeping your manual UI updates in sync with your data becomes a nightmare.

React uses a declarative UI approach. Instead of telling the browser how to change, you describe what the UI should look like based on the current state of your data. You don't touch the DOM directly; you simply tell React, "When the movie title is 'Inception', render this component." React handles the heavy lifting of updating the DOM for you.

The Power of Components

Top view layout abundance of aluminum electrolytic capacitors of varying capacity with ceramic discs placed on green background with inscription

At the heart of React architecture are components. A component is a self-contained unit of UI. It encapsulates its own structure (how it looks), its own logic (how it behaves), and its own style.

Think of a modern website like a LEGO set. Instead of building the entire castle as one giant, immovable brick, you build independent modules—the drawbridge, the tower, the flag. You can move these around, reuse them, or replace them without breaking the rest of the structure.

Why Component-Based Design?

  1. Reusability: Build a MovieCard once, and use it in your "Trending," "Favorites," and "Search Results" sections.
  2. Maintainability: If the design of your movie cards needs to change, you update one file, and the entire app updates instantly.
  3. Isolation: A bug in your search bar component is less likely to break your movie list, because they are independent entities.

Identifying Components in the Real World

Let's look at our project: a movie-browser app. If you were to sketch this on a whiteboard, how would you break it down?

  • The Main Layout: The outer shell of the app (Header, Footer, Main Content).
  • The Search Bar: A standalone input field and button.
  • The Movie Grid: A container for the list of movies.
  • The Movie Card: A single unit displaying a poster, title, and rating.

Each of these is a candidate for a component. When you start building, you'll find that components often nest inside one another, forming a tree structure. Learning how to choose these boundaries—deciding what should be a component and what shouldn't—is a critical skill that we will refine throughout this course, similar to how we discuss choosing the right boundaries for components.

Worked Example: A Simple UI Decomposition

Imagine we are building a simple header.

Imperative approach:

JAVASCRIPT
// You manually create and append elements
const header = document.createElement(CE9178">'header');
header.innerHTML = CE9178">'<h1>Movie Browser</h1>';
document.body.appendChild(header);

Declarative (React) approach:

JSX
// You describe the UI as a function
function Header() {
  return (
    <header>
      <h1>Movie Browser</h1>
    </header>
  );
}

In the React example, Header is a component. It is a predictable function that returns a description of the UI. This simplicity is why React is so powerful.

Hands-on Exercise

Look at your favorite website (e.g., Netflix, YouTube, or IMDb). Take a screenshot and draw boxes around the different UI elements you see.

  1. Identify the "Parent" components (like the main navigation or the page layout).
  2. Identify the "Child" components (like individual buttons, icons, or cards).
  3. List three parts of that page that you think could be reused in other parts of the site.

Common Pitfalls

  • Over-Engineering: Don't turn every single <div> into a component. Start simple. If you find yourself copying and pasting code, that is when you should extract a component.
  • Mixing Concerns: Try to keep your components focused. A MovieCard should display movie data; it shouldn't be responsible for fetching the data from an API or managing the global user login state.
  • Ignoring Reusability: When you build your first few components, ask yourself: "Could I use this in another project?" If the answer is yes, you're on the right track.

Recap

Yellow letter tiles spelling 'recap' against a blue backdrop, ideal for presentations.

React architecture relies on components to create declarative UIs. By shifting from imperative, step-by-step DOM manipulation to a model where components represent the state of your application, you gain the ability to build complex, maintainable, and highly reusable interfaces. We’ll be applying this principle constantly, even when we move into advanced patterns like mastering the slot pattern for cleaner code.

Up next: We will demystify how React updates the screen by looking at the Virtual DOM.

Next lesson Understanding the Virtual DOM
Back to Blog

Similar Posts

ReactReactJune 24, 20263 min read

Setting Up with Vite: A Professional React Development Environment

Learn how to initialize a professional React project using Vite. We’ll cover the project directory structure and how to launch your fast development environment.

Read more
ReactJune 24, 20264 min read

Understanding the Virtual DOM and React Performance

Part of the course

React Fundamentals: Build Modern UIs from Scratch

beginner · Lesson 1 of 49

  1. 1

    Introduction to Component-Based Architecture

    4 min
  2. 2

    Understanding the Virtual DOM

    4 min
  3. 3

    Setting Up with Vite

    3 min

Learn how the Virtual DOM works and how reconciliation optimizes your UI updates. Discover why this approach makes React faster than manual DOM manipulation.

Read more
ReactJune 23, 20265 min read

React Key Prop and Component Remounting: A Practical Guide

Master the react key prop to trigger component remounting and reset state. Learn how react reconciliation handles identity to build more predictable UIs.

Read more
  • 4

    Mastering JSX Syntax

    4 min
  • 5

    Creating Static Components

    Coming soon
  • 6

    Styling Components

    Coming soon
  • 7

    Passing Data with Props

    Coming soon
  • 8

    Dynamic Movie Cards

    Coming soon
  • 9

    Component Composition

    Coming soon
  • 10

    Conditional Rendering

    Coming soon
  • 11

    Rendering Lists of Data

    Coming soon
  • 12

    The Key Prop Explained

    Coming soon
  • 13

    Introduction to React State

    Coming soon
  • 14

    Managing State with useState

    Coming soon
  • 15

    Building an Interactive Search Bar

    Coming soon
  • 16

    Handling Click Events

    Coming soon
  • 17

    Updating State Based on Previous State

    Coming soon
  • 18

    Filtering the Movie List

    Coming soon
  • 19

    Handling Form Submissions

    Coming soon
  • 20

    Controlled Components

    Coming soon
  • 21

    Event Bubbling and Propagation

    Coming soon
  • 22

    Building a Movie Filter Toggle

    Coming soon
  • 23

    Introduction to Side Effects

    Coming soon
  • 24

    useEffect Dependencies

    Coming soon
  • 25

    Fetching Data from an API

    Coming soon
  • 26

    Handling Loading States

    Coming soon
  • 27

    Managing Errors

    Coming soon
  • 28

    Cleanup Functions in useEffect

    Coming soon
  • 29

    Debouncing Search Input

    Coming soon
  • 30

    Refactoring for Clean Code

    Coming soon
  • 31

    Folder Structure Best Practices

    Coming soon
  • 32

    Extracting Custom Hooks

    Coming soon
  • 33

    Prop Drilling and Context API

    Coming soon
  • 34

    Polishing the UI

    Coming soon
  • 35

    Finalizing the Movie Browser

    Coming soon
  • 36

    Review of Component Lifecycle

    Coming soon
  • 37

    Review of State Management

    Coming soon
  • 38

    Building a Modal Component

    Coming soon
  • 39

    Introduction to PropTypes

    Coming soon
  • 40

    Performance Optimization Basics

    Coming soon
  • 41

    Handling Browser History

    Coming soon
  • 42

    Working with LocalStorage

    Coming soon
  • 43

    Building a Favorites List

    Coming soon
  • 44

    Handling Media in React

    Coming soon
  • 45

    Introduction to Testing

    Coming soon
  • 46

    Debugging React Apps

    Coming soon
  • 47

    Deployment Basics

    Coming soon
  • 48

    Using External Libraries

    Coming soon
  • 49

    Advanced

    Coming soon
  • View full course