Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Learn React with TypeScript
  • Table Of Contents Toc
  • Feedback & Rating feedback
Learn React with TypeScript

Learn React with TypeScript - Third Edition

By : Carl Rippon
4.5 (2)
close
close
Learn React with TypeScript

Learn React with TypeScript

4.5 (2)
By: Carl Rippon

Overview of this book

Reading, navigating, and debugging a large frontend codebase can be challenging. Learn React with TypeScript, 3rd Edition helps you overcome these challenges by teaching you React, TypeScript, and Next.js, which are core technologies for building scalable, high-performance apps. Updated for React 19, this new edition covers new features such as React Server Components, server functions, and powerful modern hooks, including useFormStatus and useActionState. You'll build type-safe components using TypeScript, making this book ideal for React beginners who want to master patterns aligned with real-world frontend and React developer roles. You’ll also explore Next.js for RSCs and routing, and learn to use Zustand for global state in React—a lightweight alternative to traditional state managers. The chapters guide you through efficient data-fetching strategies with RSCs in Next.js, as well as in single-page applications (SPAs). The book also covers form handling, reusable architecture, and testing React components with Vitest to ensure robust, production-ready apps. By the end of this book, you’ll have the confidence and skills to build maintainable React applications with TypeScript and Next.js, following modern web development best practices.
Table of Contents (20 chapters)
close
close
Lock Free Chapter
1
Part 1: Introduction
5
Part 2: App Fundamentals
9
Part 3:Data
13
Part 4:Advanced React
18
Other Books You May Enjoy
19
Index

Adding checked functionality

Currently, our checklist component doesn’t contain the ability to check items, so we will now add checkboxes to the list of items, giving users the ability to check them. We will track the checked items using a React state.

So, carry out the following steps to add this functionality to our component:

  1. Open Checklist.tsx and add useState to the React import statement:
    import { ..., useState } from ‘react’;

    We will use the state to store the IDs of the checked items.

  2. At the top of the component implementation, add the state for the IDs of the checked items:
    const [checkedIds, setCheckedIds] = 
      useState<IdValue[]>([]);

    We have referenced an IdValue type that we haven’t defined yet – we’ll define this after we have finished the component implementation in step 6.

  3. Add checkboxes to the list of items as follows:
    <li key={idValue}>
      <label>
        &lt...
Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Learn React with TypeScript
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist download Download options font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon