Recent articles

Generics in TypeScript are not easy to understand when just starting out with TS. Personally I had my struggles with them in the beginning, however, once you get how they are used, they make you a more complete TypeScript developer. In this TypeScript tutorial, you will learn how to use generics in TypeScript . We will start with defining a…

Sooner or later every React developer has to handle forms. The following tutorial will give you a comprehensive overview about forms in React. You will learn how to manage form state in React, the difference of controlled and uncontrolled forms (state vs reference), how to submit a form (e.g. callback handler), and how to reset a form (e.g. after…

When using React's useState Hook in TypeScript, the method usually infers the implicit type for the returned state from the provided argument automatically. In the following example, React's useState Hook in a function component knows that it deals with a number type. Hence the returned state (here: count ) has the type number in addition to…

A brief summary of how to use React's useRef Hook for using a ref with TypeScript. First, a ref in React is mainly used to assign a HTML element to it. The assigned HTML element gives us imperative read and write operations on it which allows us to programmatically call functions. Take the following example for focusing an input element: When using…

Thoughts about the intersection of gaming and entrepeneurship ... It's been more than 15 years since I last actively played PC games. Back in the days it was all about Diablo (I/II), Warcraft (I/II/III), and Starcraft for me. When my classmates socialized in the physical world after school, I would just hang out with my guild in the World of…

React Elements, Components, and Instances are different terms in React which work closely together. This guide will walk you through all three terms and explain them step by step. We will start off with the following code snippet as example: A React component is literally the declaration of a component as we see it in the previous code snippet…

This is a comprehensive tutorial on Monorepos in JavaScript/TypeScript --- which is using state of the art tools for these kind of architectures in frontend applications. You will learn about the following topics from this tutorial: What is a monorepo? How to structure a monorepo architecture? How to create a monorepo? Which tools to use for a…

Let's start with a story: when people outside of my professional bubble ask me about what I am doing, I say "I build websites" . If they are curious, I add that these websites are rather complex. If they keep on asking, I try to elaborate with some examples: Facebook, Spotify, Twitter. It's not that I work for these companies, but I hope that it…

You may have noticed the "as" prop when working with modern UI component libraries . Essentially the "as" prop allows you to replace rendered HTML elements in a React component from the outside by passing them in as props : Usually it is called "as" prop, however, one can see it also as "component", "element", "variant" prop -- or a combination…