Mastodon hachyterm.io

I’m learning TypeScript at the moment (as well as dabbling in other things like Elixir, React Hooks, GraphQL …).

But I find it hard to apply my knowledge. It’s all fine and dandy to know what types and interfaces are, but how do I use them?

If you have the same problem, you might want to take a look at the articles written by Martin Hochell.

I especially enjoyed 10++ TypeScript Pro tips/patterns with (or without) React and Ultimate React Component Patterns with Typescript 2.8.

When using React, I also “cheat” and use the React+TypeScript Cheatsheets, a GitHub repository which explains how to use TS with React.js.

For example, they recommend using types instead of interfaces for React props - these kind of tips are useful for a beginner.

All in all, I’m still a bit confused about TypeScript and its usefulness. It makes code harder to read and adds a lot of boilerplate.