React (Typescript)

React Coding Challenges

React, built the way real teams build it. Learn to think in components and ship interfaces that stay maintainable as they grow. You'll start with components, props, and state, then move through hooks, side effects, forms, data fetching, context, performance, and the patterns production apps are built on. Every exercise is a small piece of a real UI, so you learn not just how React works, but how to make the design decisions good frontend engineers make every day. Finish able to build, structure, and reason about React applications with confidence.

React 19React 19
Read the React overview
Module 1

Components & Props

The building blocks of every React app. Learn to break a UI into reusable components and pass data into them with props — the foundation everything else builds on.

4
About this challenge

This problem covers greeting people by name, and what to show when no name has been given.

About this challenge

Here you build one shared button whose text and click behaviour are decided wherever it's used.

About this challenge

This task deals with missing profile pictures, standing in with the person's initials instead.

About this challenge

The focus here is showing a shopper the old price, the discounted price, and what they save.

Module 2

Calculators & Derived State

In this module, you’ll learn how to avoid redundant data by using derived state - values computed from existing state instead of stored directly. You’ll also explore calculators, functions that automatically keep these values up to date whenever dependencies change.

3
About this challenge

Build a checkout calculator that takes a base price, discount % and tax %, then shows the subtotal, tax and final price, with discount applied before tax. A quick task to show you can get a calculation's order right.

About this challenge

Build a component where scores are added one at a time and the running average and letter grade update as you go. A simple task to show you can compute from a growing list and handle the edges safely.

About this challenge

Build a loan calculator with controls for amount, interest rate and tenure, showing the monthly instalment, total repayable and total interest as you move them. A good task to show you can drive a real formula from live inputs.

Module 3

Composition & Communication

Building UI from reusable wrappers that accept children, and lifting state up so a parent owns the shared value while children stay controlled and stateless.

3
About this challenge

Library Card is an Easy composition question that hands the candidate a library membership desk - name, card number, and tier controls with a live card preview that fills in as they type. They build one reusable field wrapper that labels and composes any control and shows an inline error, plus the two validators behind the member name and card number.

About this challenge

Sign up to see what this challenge asks.

About this challenge

Compose a profile form from a reusable Field wrapper with all state lifted to the parent, and implement the derived isComplete check that gates the Continue button.

Module 4

Forms & Inputs

Controlled inputs and the submit lifecycle: validation, per-field inline errors, blocking invalid submits, and emitting a clean payload.

4
About this challenge

A contact form that checks what the visitor typed before it's sent, points at exactly what needs fixing, and confirms once the message is on its way.

About this challenge

Generate random passwords honoring a configurable length and character-class toggles, guaranteeing at least one character from each enabled class.

About this challenge

Compute live word count, character counts (with/without spaces), and reading time from a controlled textarea on every keystroke.

About this challenge

Build a validated add-song form that appends to an editable list with mm:ss parsing/formatting and a live total-duration display.

Module 5

Lists & Collections

Rendering arrays and updating them immutably: add, toggle, remove, keys and stable identity, derived counts and totals, and safe empty states.

4
About this challenge

Implement add, toggle, delete, and a live remaining-count for a pre-built React + TypeScript todo app; the UI, wiring, and seed data are provided.

About this challenge

Wire up a studio-gear checkout cart by implementing the pure functions that drive each line total, the order total, and quantity changes (including remove-on-zero).

About this challenge

Build the selection logic for a photography gallery viewer: show the first image by default, swap the hero when a thumbnail is clicked, and mark exactly the active thumbnail in a six-frame contact strip.

About this challenge

Implement a custom hook that loads contacts from an API on mount and a pure filter function, so a provided Contacts panel supports async loading, live case-insensitive search, and per-row remove.

Module 6

Side Effects & Data Fetching

useEffect against a backend, where correctness depends on the failure modes: debouncing input-driven requests, ignoring stale responses so an older one can't overwrite a newer, retrying transient failures with backoff, polling until a terminal status, and cleaning up timers on unmount.

5
About this challenge

Build a movie search that waits until you stop typing before querying, and throws away results for a search you've already moved on from. A good task to show you can stop slow responses arriving out of order.

About this challenge

Build a paginated product list where the server sends one page at a time, with Prev and Next disabled at the ends. A practical task to show you can keep page state and the server in step.

About this challenge

Build a forecast loader that retries a failed request a few times with increasing gaps, then gives up cleanly with a manual retry. A good task to show you can handle flaky networks without hammering the server.

About this challenge

Sign up to see what this challenge asks.

About this challenge

Build two dashboard panels that load different data but share one reusable hook for loading and error handling. A rounded task to show you can spot repetition and pull it into something reusable.

Module 7

Custom Hooks

Extracting stateful logic into reusable units tested on their own with renderHook. Learners rebuild useDebounce, useLocalStorage, useFetch and useForm, making real design calls about return shape, derived vs. stored values, dependencies and cleanup.

5
About this challenge

Build a useDebounce hook that only reports a value once it stops changing, clearing pending timers as it goes. A quick task to show you can package timing behaviour into a clean hook.

About this challenge

Build a useLocalStorage hook so a half-finished form survives a page refresh. A simple task to show you can sync React state with browser storage safely.

About this challenge

Build a useFetch hook that refetches when its URL changes and ignores a response that arrived for the old one. A good task to show you understand where race conditions come from.

About this challenge

Bring a store's checkout form to life - track what the shopper enters, flag invalid or missing details, and let the order go through only when every field is valid.

About this challenge

Build a working shopping cart where customers can add items, change how many they want, remove things, and see the price total update automatically.

Module 8

Reducers & State Logic

useReducer for state too tangled for scattered setState calls: named actions into a pure, unit-testable reducer, plus selectors that derive filtered lists, counts and flags rather than duplicating them in state.

4
About this challenge

Build the logic behind a task board. The screen is ready - a list of tasks, tabs for All, Active, and Completed, and a counter for tasks left - but nothing responds yet. Make it work: add tasks, check them off, delete them, clear completed ones, and switch filters so the board always shows the right tasks and the right count.

About this challenge

The back-office dashboard for an online store, where the team searches, sorts, and reviews orders. It's fully designed but the controls aren't wired up yet — the sidebar, search, and column sorting don't respond.

About this challenge

Build the "select rows" behavior for a team members table. Tick a row to select it, use the header checkbox to select or clear everyone at once, and keep a running count of what's chosen - the kind of multi-select you see in any admin dashboard or inbox.

About this challenge

Bring a finished-looking sign-up form to life by writing the logic that tracks what's been typed, what's been touched, and what's invalid — so the form validates, enables its button, and resets correctly.

Module 9

Forms & Validation

Forms & Validation is a graduated React path where each question hands the candidate a finished, working UI and asks only for the pure logic behind it - validation, form state, and the rules that gate submission. It builds from per-field validation and submit gating, through dynamic array state and async hooks, up to a context-and-reducer multi-step wizard that composes it all.

4
About this challenge

Build a registration form whose validation is a pure, testable function. The form UI (fields, inline error slots, submit button) is provided and wired; the validator is missing, so nothing validates and submit is never gated.

About this challenge

Sign up to see what this challenge asks.

About this challenge

During sign-up, check a chosen handle's availability against the backend as the user types. The handle input and the status indicator are provided and wired; the debounced fetch + status logic is missing, so the indicator never changes.

About this challenge

Build a multi-step signup wizard whose step data is shared through context and validated per step. The wizard shell, the three step screens, and the Next/Back controls are provided and wired; the context reducer, the per-step validators, and the submit aggregator are missing, so navigation never gates and data does not persist.

Module 10

Context & Shared State

Context & Shared State is a graduated React path where each question hands the candidate a finished UI and asks only for the pure logic behind shared state - what lives in context, how it changes, and who re-renders. It climbs from a permission-checked auth context, through a reducer-backed notification queue and a selector-subscribed store, up to a cached resource context (mini react-query) that composes it all.

4
About this challenge

In a SaaS admin app, auth state and a permission check are exposed through context, but the permission helper and the login/logout transitions are unimplemented, so `can(...)` never returns the right answer and signing in or out does not change what a consumer may see.

About this challenge

The app needs a real app-wide notification center - a queue, not a single toast. The provider and the toast list UI are provided and wired, but the queue reducer and the auto-dismiss scheduling are missing, so notifications never appear, never collapse duplicates, and never time out.

About this challenge

A dashboard has many widgets reading one shared store. Today every store update re-renders every consumer. The store provider and the widgets are provided; the subscription mechanism that isolates re-renders is missing, so an unrelated update repaints the whole board.

About this challenge

Build a lightweight data-cache context - a mini react-query - that fetches, caches, de-dupes in-flight requests, and invalidates by key. The provider, the consuming widgets, and the API base configuration are provided; the cache logic and the `useResource` hook are missing, so every consumer refetches and nothing is shared.

Module 11

Async Patterns

Async Patterns is a graduated React path where each question hands the candidate a finished UI and asks only for the pure async logic behind it - how requests fire, settle, and update state. It builds from an optimistic like with rollback, through a guarded de-duped load-more feed and a parallel dashboard that degrades on partial failure, up to a fetch-once client-filtered dataset that derives every view from one cached set.

4
About this challenge

On a social feed, a like button should feel instant - flip the liked state and count immediately, then confirm with the server. The button and the post card are provided and wired, but the optimistic toggle + rollback logic is missing, so clicking does nothing and a failed request is never undone.

About this challenge

In a news reader, a "Load more" button should append the next page of articles. The list and the button are provided and wired, but the paging logic is missing, so the button does nothing, duplicates can slip in, and it never disables at the end.

About this challenge

An analytics dashboard needs three independent resources at once. The panels and the combined loading UI are provided and wired, but the parallel-load logic is missing, so the dashboard never resolves and one failing request would take the whole page down.

About this challenge

A team directory loads its full member roster once, then filters and sorts it live in memory as the user types. The header, toolbar, and results table are provided and wired, but the filter/sort logic and the fetch-once hook are missing, so the table stays empty and typing does nothing.

Module 12

Performance Optimization

Performance Optimization is a graduated React path where each question hands the candidate a finished UI and asks only for the pure logic that keeps it fast - windowing, reference-preserving updates, and memoization boundaries. It builds from a virtualized transactions table, through a memo-optimized kanban board and a dashboard whose expensive aggregation recomputes only when its inputs change, up to an infinite virtualized feed over a normalized store that composes it all.

4
About this challenge

A banking screen must render 50,000 transactions smoothly. The header summary, filter bar, and scroll container are provided and wired, but the windowing + filter/sort logic is missing, so the table tries to mount every row (or nothing) and never filters or sorts.

About this challenge

On a kanban board, interacting with one card must never re-render the whole board. The columns, cards, and the add/edit/move controls are provided and wired, but the state ops and stable handlers are missing, so editing one card either does nothing or repaints every card.

About this challenge

A metrics dashboard derives expensive aggregates (grouping, percentiles) from a large dataset. The tabs, theme toggle, and chart chrome are provided and wired, but the aggregation + its memo boundary are missing, so it either recomputes on every unrelated click or never computes.

About this challenge

A social feed must stay fast while endlessly scrolling. The feed shell, the memoized post component, and the sentinel are provided and wired, but the infinite-load + windowing + normalized store are missing, so scrolling either mounts everything, refetches endlessly, or lets the same post drift out of sync across the places it appears.

About this path

This path starts with components and props and goes on to state, forms, effects, custom hooks, reducers, context and performance. You should be comfortable with HTML, CSS and modern JavaScript before you start. No earlier React experience is needed. Later challenges include a virtualized transactions table, a memo-optimized kanban board and an infinite feed.

From the blog

4
Why your React effect runs twice in devReact StrictMode double-invokes effects in development on purpose. Here's why, what it's catching, and how to write effects that survive it — with proper cleanup.How to review a React pull requestA shareable, team-facing checklist for reviewing React pull requests — correctness, hooks, state, performance, accessibility, and tests.React performance: what to fix firstA saveable checklist for shipping fast React apps — cut wasted re-renders, trim bundles, fix data waterfalls, and measure what matters.How to prep for a frontend interviewA practical, framework-first plan to prepare for frontend engineering interviews — fundamentals, real features, and a four-week schedule.

Frequently asked questions

4

What will I practice in this path?

12 modules: Components & Props, Calculators & Derived State, Composition & Communication, Forms & Inputs, Lists & Collections, Side Effects & Data Fetching, Custom Hooks, Reducers & State Logic, Forms & Validation, Context & Shared State, Async Patterns and Performance Optimization.

How many challenges are there, and how hard are they?

48 challenges: 19 easy, 25 medium and 4 hard.

What does this path run on?

Challenges run on React 19.

Do I need to install anything?

No. Every challenge runs in a browser-based IDE with everything already set up, and your code is graded automatically against a test suite.

We use cookies that are necessary to run Staffcoder, and optional analytics cookies to see which pages get used. Analytics stays off unless you accept. Read our Cookie Policy.