Concurrent Rendering — Complete Guide
Concurrent Rendering — Complete Guide: free step-by-step lesson with examples, common mistakes, and interview tips — part of React.js Tutorial on Toolliyo Academy.
On this page
React.js Tutorial · Lesson 57 of 100
Concurrent Rendering
Beginner ✓ → Intermediate ✓ → Advanced → Professional
Advanced · 3 — Production skills · ~18 min read · Module 6: Architecture & React 19
Introduction
This is advanced material: Concurrent Rendering. It is what teams use on live products. Read the example carefully and try changing one line at a time to see what happens. Concurrent rendering lets React pause, prioritize, and resume work. Urgent updates (typing) can interrupt slow renders (heavy lists). Keeps input responsive even when the tree is large. useTransition marks updates as non-urgent.
You do not need every modern feature on day one. Read this so you recognize the words in job posts and team meetings.
When will you use this?
Learn this when you join a team on React 18/19 or Next.js — not required for your first todo app.
- New React apps may use Server Components and Suspense for faster first load.
- Next.js jobs expect you to know when code runs on server vs browser.
Real-world: smooth search on huge list
Naukri job list has 10k rows. startTransition marks filter update as non-urgent so typing in search box stays responsive.
Production-style code
import { useState, useTransition } from 'react';
function JobBoard({ jobs }) {
const [query, setQuery] = useState('');
const [filtered, setFiltered] = useState(jobs);
const [pending, startTransition] = useTransition();
function onSearch(value) {
setQuery(value);
startTransition(() => {
setFiltered(jobs.filter(j => j.title.includes(value)));
});
}
return (
<>
<input value={query} onChange={e => onSearch(e.target.value)} />
{pending && <span>Updating…</span>}
<JobList jobs={filtered} />
</>
);
}
What happens in production: Concurrent features keep input at 60fps while expensive list filter runs — React 18+ default behavior.
Lesson example (start here)
Copy this smaller example first. Once it works, compare it with the real-world code above.
const [isPending, startTransition] = useTransition();
const [filter, setFilter] = useState('');
function onChange(e) {
setFilter(e.target.value); // urgent
startTransition(() => {
setDeferredFilter(e.target.value); // slow list can wait
});
}
Line-by-line walkthrough
| Code | What it means |
|---|---|
const [isPending, startTransition] = useTransition(); | Part of the Concurrent Rendering example — read it together with the lines before and after. |
const [filter, setFilter] = useState(''); | Creates state: a value that can change, plus a function to update it. |
function onChange(e) { | Defines a function — often a component or event handler. |
setFilter(e.target.value); // urgent | Part of the Concurrent Rendering example — read it together with the lines before and after. |
startTransition(() => { | Defines a function — often a component or event handler. |
setDeferredFilter(e.target.value); // slow list can wait | Part of the Concurrent Rendering example — read it together with the lines before and after. |
}); | Closes a block started by { or ( above. |
} | Closes a block started by { or ( above. |
How it works (big picture)
- startTransition tells React the inner update is lower priority.
- isPending can dim the list while filtering.
Do this on your computer
- Identify slow update the screens (big lists, charts).
- Wrap their state updates in startTransition.
- Show isPending feedback.
- Read the real-world section and name which part of the app uses this topic.
- Run the example locally and confirm the same behavior in the browser.
- Change one value in the example (text, initial state, or URL) and predict what will happen before you save.
Experiments — try changing this
- Change text or labels in the example and save — watch the browser update.
- Break the code on purpose (remove a bracket), read the error message, then fix it.
- Change the initial state value and see the starting UI change.
- Open React DevTools (browser extension) while running Concurrent Rendering and inspect component props/state.
Remember
Concurrent mode prioritizes user input. useTransition for deferrable updates. Enabled by default in React 18+.
Common questions
Do I enable concurrent manually?
React 18+ uses it automatically with createRoot.
How long should I spend on Concurrent Rendering?
Until you can explain it in your own words and run the example without looking at the answer. Beginners often need 30–60 minutes per new hook or routing topic; setup lessons may take one afternoon.
What if I get stuck on Concurrent Rendering?
Re-read the line-by-line walkthrough, check the browser console for red errors, and compare your code character-by-character with the example. Search the exact error text — someone else had it too.
Where is Concurrent Rendering used in real jobs?
See the real-world section above — the same pattern appears in LMS, banking, e-commerce, and SaaS products. Interviewers ask you to explain it using one concrete example from your project or this lesson.
Sign in to ask a question or upvote helpful answers.
No questions yet — be the first to ask!