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

By : Carl Rippon
close
close
Learn React with TypeScript

Learn React with TypeScript

By: Carl Rippon

Overview of this book

Reading, navigating, and debugging a large frontend codebase can feel overwhelming for web developers, but you can overcome this with expert guidance from a seasoned software professional with over 20 years’ experience in developing a complex line of business applications. This book will help you learn React, TypeScript, and Next.js—the core technology stack behind scalable, high-performance web applications used by top companies. This third edition of Learn React with TypeScript is updated with the latest features of React 19, including server components, server actions, and powerful new hooks. The chapters show you how to use TypeScript’s advanced features for enhanced code reliability and maintainability when building robust, type-safe components. You’ll explore efficient data fetching strategies with RSCs in Next.js, as well as in single-page applications (SPAs). The book also covers modern state management with Zustand, best practices for form handling, and strategies for building well-structured, reusable components that streamline development. Finally, you’ll focus on unit testing with Vitest, ensuring your React components are resilient and error-free. By the end of this book, you'll have at your disposal the skills and best practices needed to create maintainable and performant React applications with TypeScript and Next.js.
Table of Contents (19 chapters)
close
close
Free Chapter
1
Part 1: Introduction
5
Part 2: App Fundamentals
9
Part 3:Data
13
Part 4:Advanced React
18
Index

What this book covers

Chapter 1, Getting Started with React, covers creating React projects and the fundamentals of building React components. This includes making a component configurable using props and interactive using state.

Chapter 2, Getting Started with TypeScript, starts with the fundamentals of TypeScript and its type system. This includes using inbuilt types as well as creating new types. The chapter then covers creating a React component with TypeScript types.

Chapter 3, Using React Hooks, details the common React Hooks and their typical use cases. The chapter also covers how to use the Hooks with TypeScript to make them type-safe.

Chapter 4, Approaches to Styling React Frontends, walks through how to style React components using several different approaches. The benefits of each approach are also explored.

Chapter 5, Using React Server and Client Components, covers how and when to use React Server Components and Client Components and also how to compose them together.

Chapter 6, Creating a Multi-Page App with Next.js, covers the fundamentals of building multi-page apps in a popular React framework called Next.js. This includes implementing different pages, links between them, and page parameters.

Chapter 7, Server Component Data Fetching and Server Function Mutations, demonstrates how React Server Components can fetch data from a database. The chapter also includes mutating database data using a React Server Function.

Chapter 8, Client Component Data Fetching and Mutations with TanStack Query, covers how React Client Components can fetch and mutate data from a database using a popular library called TanStack Query.

Chapter 9, Working with Forms, explores how forms can be implemented using several different approaches, including the latest React Hooks and a popular forms library.

Chapter 10, State Management, walks through how React state can be shared between different components. Several approaches are explored along with their benefits.

Chapter 11, Reusable Components, brings in several patterns for making React components highly reusable but still type-safe.

Chapter 12, Unit Testing with Vitest and the React Testing Library, first delves into how functions can be tested with Vitest. The chapter then moves on to how React components can be tested with the help of the React Testing Library.

Unlock full access

Continue reading for free

A Packt free trial gives you instant online access to our library of over 7000 practical eBooks and videos, constantly updated with the latest in tech

Create a Note

Modal Close icon
You need to login to use this feature.
notes
bookmark search playlist download font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Delete Note

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Edit Note

Modal Close icon
Write a note (max 255 characters)
Cancel
Update Note

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