A collection of real React performance problems for you to solve.
Each problem is intentionally written with bad practices. Your job is to identify what is wrong and fix it using React best practices.
I created this repository as a personal way to practice React performance topics that have come up in technical interviews. The inspiration came from the article How to Measure and Optimize React Performance by Anna Monus, from which I learned a lot. If you haven't read it, start there.
Most React performance content shows you the solution. This project shows you the problem and lets you figure out the rest. The goal is to build muscle memory for spotting performance issues in real codebases.
Each exercise is a wild encounter. The component has a real performance problem your job is to open React DevTools, profile it, and catch the issue before it escapes.
Just like a Pokémon trainer doesn't memorize every move they learn to read the battle.
| Pokémon | Problem | Why |
|---|---|---|
| Magikarp | Unnecessary Re-renders | Lots of effort, zero result |
| Bill's PC | List Virtualization | Stores hundreds, shows only the current box |
| HM Slave | Bad State Placement | Pollutes the move set of whoever holds it |
| Pokédex | Heavy Bundle | Don't load all 1010 before showing the first |
| Quick Claw | Slow Interactions | Prioritizes who needs to move first |
| Corrupted Save | Costly Hydration | 30 seconds to load a game you already finished |
💡 Want to contribute? You don't have to use Pokémon. The analogy can be anything cooking, sports, movies, music as long as it makes the performance problem click for someone who has never heard of React. If you can explain it to a non developer, it belongs here How would you explain it to someone who is just getting started?.
- Read the docs start at slowreact.vercel.app to understand the context of each exercise.
- Clone the repository get the code running locally.
- Open the exercise folder each problem has its own
README.mdwith a detailed explanation of the issue, what to look for, and references to help you solve it. - Fix the problem no spoilers in the code. The solution is yours to find.
| # | Problem | Concept |
|---|---|---|
| 01 | Unnecessary Re-renders | memo, useMemo, useCallback |
| 02 | Bad State Placement | state colocation, prop drilling |
| 03 | List Virtualization | windowing, react-window |
| 04 | Heavy Bundle | tree shaking, lazy imports |
| 05 | Slow Interactions | useTransition, useDeferredValue |
| 06 | Costly Hydration | SSR, React Server Components |
git clone git@github.com:ManuelPauloAfonso/slowreact.git
cd slow-react
pnpm install
pnpm dev- Open the problem folder inside
src/problems/ - Read the
README.mdinside the folder - Open
Problem.tsxand identify what is wrong - Fix it directly in the file
- Use React Developer Tools Profiler to validate your solution
- Vite
- React 19
- TypeScript
See CONTRIBUTING.md