Book Image

Learn React with TypeScript - Second Edition

By : Carl Rippon
4.4 (8)
Book Image

Learn React with TypeScript - Second Edition

4.4 (8)
By: Carl Rippon

Overview of this book

Reading, navigating, and debugging a large frontend codebase is a major issue faced by frontend developers. This book is designed to help web developers like you learn about ReactJS and TypeScript, both of which power large-scale apps for many organizations. This second edition of Learn React with TypeScript is updated, enhanced, and improved to cover new features of React 18 including hooks, state management libraries, and features of TypeScript 4. The book will enable you to create well-structured and reusable React components that are easy to read and maintain, leveraging modern design patterns. You’ll be able to ensure that all your components are type-safe, making the most of TypeScript features, including some advanced types. You’ll also learn how to manage complex states using Redux and how to interact with a GraphQL web API. Finally, you’ll discover how to write robust unit tests for React components using Jest. By the end of the book, you’ll be well-equipped to use both React and TypeScript.
Table of Contents (19 chapters)
1
Part 1: Introduction
6
Part 2: App Fundamentals
10
Part 3: Data
14
Part 4: Advanced React

To get the most out of this book

To get the most out of this book, you need to know the basics of JavaScript, including the following:

  • An understanding of some of the primitive JavaScript types, such as string, number, boolean, null, and undefined
  • An understanding of how to create variables and reference them, including arrays and objects
  • An understanding of how to create functions and call them
  • An understanding of how to create conditional statements with the if and else keywords

You also need to know the basics of HTML, including the following:

  • An understanding of basic HTML elements such as div, ul, a, and h1
  • An understanding of how to reference a CSS class to style an HTML element

An understanding of basic CSS is also helpful, including the following:

  • How to size elements and include margins and padding
  • How to position elements
  • How to color elements

To follow along with this book, you will need the following technologies installed on your computer:

Software/hardware covered in the book

React 18.0 or later

TypeScript 4.7 or later

If you are using the digital version of this book, we advise you to type the code yourself or access the code from the book’s GitHub repository (a link is available in the next section). Doing so will help you avoid any potential errors related to the copying and pasting of code.