Latest posts

Error TS1196: Catch clause variable type annotation

2021-03-07 Best Practices

By default, TypeScript’s compiler doesn’t allow you to add a custom type annotation to an error in a try-catch statement (TS1196). That’s because the underlying code can throw any type of error, even system generated exceptions, which makes it impossible for TypeScript to know the error type from the start. Luckily, there is the concept called “type guards“ which can help the TypeScript compiler to infer a specific type.

Continue reading →

React with TypeScript for Beginners

2021-02-22 React

It’s 2021 and TypeScript’s support for React apps improved by a lot. If you are new to TypeScript and React, you can learn from Amir Ghezelbash how to develop your first React app. In his tutorials, Amir starts from scratch and shows you on a weekly basis how to improve your React and TypeScript skills.

Continue reading →

When to use static methods in TypeScript?

2020-10-07 Best Practices

When developing class functions that don’t rely on an internal state, it’s a good idea to turn them into static methods. This can be easily done by adding the keyword static to your function’s declaration.

Continue reading →

Fastest way to set up a TypeScript project with Node.js (npm)

2020-08-04 Hands-On

Setting up a TypeScript project with Node.js takes only a few minutes. Here is how to do it the fastest way by just using npm and yarn.

Continue reading →

TypeScript code coverage with Karma

2019-04-28 Testing

Configuring code coverage with TypeScript and Karma to get coverage reports for code running in web browsers.

Continue reading →

Run Node.js apps on Heroku with TypeScript

2019-03-18 Hands-On

The best way to get started on the Heroku polyglot platform is to follow their fantastic introduction. It’s also worth reading about their supported environments, deployment tasks and European deployment region. The second best advice is to follow our quick setup guide.

Continue reading →