Express + TypeScript: Extending Request and Response objects
This article shows you how to add new properties to an Express request object (we often deal with this task when working with middleware) or an Express response (not too common but may be necessary in…
React + TypeScript: Working with Radio Button Groups
The end-to-end example below covers the most important aspects you need to know when working with radio button groups in a React application written in TypeScript. We will write code from scratch and use the modern…
React + TypeScript: Making a Custom Context Menu
This article walks you through an end-to-end example of creating a custom context menu in a React app that is written in TypeScript. We’ll use new features of React like hooks and functional components. You won’t…
React + TypeScript: Multiple Select example
The example below describes how to use a multiple select in a React project written in TypeScript. You will learn to get the selected values as well as display them on the screen. Everything will be…
React + TypeScript: onMouseOver & onMouseOut events
This article is about the onMouseOver and onMouseOut events in a React project written in TypeScript. We’ll go through the fundamentals of these events then examine a complete example of using them in practice. Overview The…
React + TypeScript: Image onLoad & onError Events
The end-to-end example below shows you how to handle image events in a React app that uses TypeScript. There are 2 events that we are going to work with: onLoad: This event occurs when an image…
React + TypeScript: Handling onClick event
The onClick event occurs when an element is clicked. This element can be a button, a div element, an image, etc. This article walks you through a couple of different examples of handling the onClick event…
React + TypeScript: Handling Keyboard Events
This article walks you through the basics and a few practical examples of handling keyboard events in a React app that is written in TypeScript. We’ll use modern React features including hooks and functional components. You…
React + TypeScript: Multiple Dynamic Checkboxes
This article walks you through an end-to-end example of handling dynamic checkboxes in a React application written in TypeScript. We’ll use hooks and functional components, not class components as well as old-fashioned stuff. The Example Overview…
React + TypeScript: Password Strength Checker example
This article walks you through a complete example of making a password strength checker in React and TypeScript. We will build it from scratch and will NOT use any third-party packages. In addition, we will use…
TypeScript: Intersection Type Examples
Below are 2 examples of Intersection Types in TypeScript. The first one uses Interfaces and the second one uses Type Aliases. Example 1: Intersection Types and Interfaces The code: Output: Example 2: Intersection Types and Type…
TypeScript Example: Default Function Parameters
The code snippet below shows you how to use default function parameters in TypeScript: Output: Important note: The parameters for which you don’t accept default arguments have to come first (stay on the left side). Further…
« Previous 1 2 3 Next »