React Declarative Model

The React declarative model means you describe what the UI should look like for a given state, and React figures out how to make the UI match that description.

You don’t tell React how to update the DOM step by step — you tell it what the UI should be.

Imperative (what to do)

You manually describe every step:

const button =document.querySelector("button");
button.disabled =true;
button.textContent ="Loading...";
Aspect Declarative (React Model) Imperative (Vanilla JavaScript)
Focus What the final UI should be (the desired result). How to achieve the result (step-by-step instructions).
DOM Abstracts away direct DOM manipulation. You use JSX to describe components. Requires manual selection and modification of specific DOM elements (e.g., document.createElementelement.appendChild).
Updates React uses a Virtual DOM to compare the new and old UI descriptions and apply only necessary changes. The developer must explicitly write code to handle all possible updates, additions, and removals for every state change.
Analogy Telling a butler, "I want dinner with chicken". Giving a butler detailed instructions: "Go to the kitchen, open the fridge, remove the chicken...".

Declarative (what it should be)

React handles:

You describe the desired UI:

<button disabled={isLoading}>
  {isLoading ?"Loading..." :"Submit"}
</button>

JSX Components + Elements

Screenshot 2026-01-13 at 8.34.53 AM.png

Screenshot 2026-01-13 at 8.42.01 AM.png

component composition

Screenshot 2026-01-13 at 8.53.38 AM.png

containment

specialization

containment + specialization in action

Screenshot 2026-01-13 at 9.15.36 AM.png

Screenshot 2026-01-13 at 9.16.45 AM.png

generic components

specialization

containment

Screenshot 2026-01-13 at 9.27.00 AM.png

types of children