This is the code repository for Learn React with TypeScript - Second Edition, published by Packt.
A beginner's guide to reactive web development with React 18 and TypeScript
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 book covers the following exciting features:
- Gain first-hand experience of TypeScript and its productivity features
- Understand how to transpile your TypeScript code into JavaScript for running in a browser
- Build a React frontend codebase with hooks
- Interact with REST and GraphQL web APIs
- Design and develop strongly typed reusable components
- Create automated component tests
If you feel this book is for you, get your copy today!
All of the code is organized into folders. For example, Chapter02.
The code will look like the following:
class Product {
constructor(public name: string, public unitPrice:
number) {
this.name = name;
this.unitPrice = unitPrice;
}
}
Following is what you need for this book: This book is for experienced frontend developers looking to build large scale web applications using React and TypeScript. Intermediate knowledge of JavaScript, HTML and CSS is a prerequisite.
With the following software and hardware list you can run all code files present in the book (Chapter 1-12).
Chapter | Software/Hardware required | OS required |
---|---|---|
1-12 | Google Chrome | Windows, Mac OS X, and Linux |
1-12 | Node.js and npm | Windows, Mac OS X, and Linux |
1-12 | Visual Studio Code | Windows, Mac OS X, and Linux |
1-12 | React 18.0 or later | Windows, Mac OS X, and Linux |
1-12 | TypeScript 4.7 or later | Windows, Mac OS X, and Linux |
We also provide a PDF file that has color images of the screenshots/diagrams used in this book. Click here to download it.
- Page 137: In Step 7, React.tsx should be Reset.tsx
- Page 302, In Step 5,
if '!('ti'le' in post)) {
throw new Err"r("post do'sn't contain ti"le");
}
if (typeof post.title !'= 'str'ng') {
throw new Err'r('title is not a str'ng');
}
if '!('descript'on' in post)) {
throw new Err"r("post do'sn't contain descript"on");
}
if (typeof post.description !'= 'str'ng') {
throw new Err'r('description is not a str'ng');
}
should be
if (!("title" in post)) {
throw new Error("post doesn't contain title");
}
if (typeof post.title !== "string") {
throw new Error("title is not a string");
}
if (!("description" in post)) {
throw new Error("post doesn't contain description");
}
if (typeof post.description !== "string") {
throw new Error("description is not a string");
}
Carl Rippon has been in the software industry for over 20 years developing complex lines of business applications in various sectors. He has spent the last 8 years building single-page applications using a wide range of JavaScript technologies including Angular, ReactJS, and TypeScript. He has also written over 100 blog posts on various technologies.
If you have already purchased a print or Kindle version of this book, you can get a DRM-free PDF version at no cost.
Simply click on the link to claim your free PDF.