Skip to main content

Getting Started — visual mental model

Before writing many components, understand how source code becomes a running React application.

From source code to visible React UIReact is the UI library; Vite and the browser provide surrounding tooling and runtime pieces.
1JSX + JavaScript source
2Vite transforms/bundles modules
3Browser loads the application
4createRoot connects React to a DOM container
5root.render(<App />)
6React renders the component tree

The root bridge​

Browser DOM container → React root → component tree
Browser DOM node
<div id="root"></div>
React root
React can now manage UI inside this container.
App component tree
Components calculate the interface for their current inputs.
DOM updates
The browser receives only the host changes React decides are necessary.

React core vs tooling​

Know which layer owns what
ReactUI model
components · state · rendering · Hooks · Context
ViteDevelopment/build tooling
dev server · module transforms · production build
BrowserHost environment
DOM · events · layout · paint · browser APIs

Rendering is not the same as DOM mutation​

The first render pipeline
1Root render requested
2Components calculate UI
3React reconciles structure + identity
4Necessary host changes commit
5Browser paints

Strict Mode​

Strict Mode is a development stress testRepeated work helps reveal unsafe render logic and missing cleanup before production.
Component appears to work
Repeat render logic
Find impure rendering.
Repeat Effect setup/cleanup
Find missing cleanup.
Check deprecated/unsafe patterns
Surface problems earlier.
Safer component assumptions
Code should remain correct when work is restarted or repeated.

Where should you begin?​

What do you need right now?
Understand what React isWhat is React?
Create a small client-side learning projectSet Up React with Vite
Understand createRoot and root.renderRendering a React Application
Understand repeated development checksStrict Mode

Keep this picture in your head​

React application startup
Tooling
loads code
Root
connects React
Components
calculate UI
Browser
shows committed result

Continue through the detailed Getting Started chapters for installation, project structure, createRoot, first rendering, and Strict Mode behavior.