Introduction

Get a brief overview of the course, including the topics covered and the intended audience.

What is TypeScript?

TypeScript is a free and open-source programming language developed and maintained by Microsoft. Microsoft’s slogan for TypeScript is “JavaScript that scales,” emphasizing its ability to facilitate the development of large JavaScript-based applications. It is a superset of JavaScript, meaning that any valid JavaScript code is also a valid TypeScript code. TypeScript adds static typing to JavaScript, bringing a set of features and enhancements that help developers catch errors early in the development process and improve code maintainability.

Press + to interact

TypeScript doesn’t run directly in the browser. Similar to JSX, it requires conversion to JavaScript before execution. The TypeScript compiler performs this conversion after type checking the code.

Target audience

This course is for intermediate-level JavaScript developers who want to learn about TypeScript’s powerful features.

Course contents

This course covers five chapters and an assessment at the end. Let’s discuss what each chapter covers below:

  1. Simplifying Reducers in React with TypeScript: This chapter starts with the challenges of managing state in large React applications and the benefits of static type checking. It discusses the basics of reducers in the context of React and Redux. It also covers essential concepts such as defining actions, creating a basic reducer, and the potential drawbacks of using Redux. The integration of TypeScript is explored to enhance code quality, enforce type safety, and streamline the reducer development process.

  2. A Gentle Introduction to Generics in TypeScript: This chapter introduces the concepts of generics in TypeScript, providing the foundation for understanding and using them effectively. It is also for readers familiar with other dynamic languages like JavaScript or Python, emphasizing that generics in TypeScript allow for writing reusable code that works with multiple types.

  3. Navigating the Perils and Pitfalls of Using React’s Context API with TypeScript: This chapter discusses the challenges of using TypeScript with React’s Context API and provides solutions to maintain type safety while working with contexts. It introduces a practical example of building a color picker application that utilizes the Context API to share color-related functionalities throughout the component hierarchy.

  4. Extending DOM Elements and Creating Polymorphic Components: This chapter explores strategies for extending HTML element properties in React components and creating polymorphic components using TypeScript. It also demonstrates how to build abstractions over HTML elements, enhance their behavior, and create versatile components that can adapt to different elements.

  5. A Guided Tour of the Three Biggest Features in TypeScript 5.0: This chapter delves into the new features introduced in TypeScript 5.0, focusing on three major enhancements:

    • Decorators
    • The const type parameters
    • Upgraded and enhanced enums