👋 I'm Cam McHenry

I am a software engineer that is passionate about building great web applications. Currently, I work at GitHub.

I often write about TypeScript and React in my blog, and occasionally write some useful tools.

Posts

  • How to check all cases were handled in a switch/case block in TypeScript

    In TypeScript, you can use the `never` type to check that all cases were handled in a switch/case block.

  • How to pick and omit keys in TypeScript

    Learn how to exclude and include properties from objects or arrays of objects in TypeScript as well as JavaScript.

  • How to disable UI and control focus with the inert attribute

    The inert attribute is a new accessibility primitive that can be used to disable off-screen or non-interactable UI elements and prevent focus from moving to them.

  • TypeScript Utility Types Guide

    Utility types are included with TypeScript to help with common typing tasks. In this article, we will see how utility types can be used to manipulate unions, objects, strings, and other types.

  • How to add a RSS feed to a Remix app

    Remix allows you to generate responses for any kind of page, not just rendering React components, which can be used to easily create a RSS feed for a blog.

  • How to debug HTML elements that disappear from the document

    There are a few ways to debug temporary HTML elements and states, but there is a simple solution involving opening the debugger with a timeout.

  • How to write custom ESLint rules for your project

    ESLint is a great tool for analyzing code, but it can be a bit of a hassle to set up when it comes to making your own rules. This is a quick guide on how to create a TypeScript ESLint plugin, write a custom rule, and write tests for it.

  • The Difference Between TypeScript Unions, Enums, and Objects

    In this guide, we'll examine when you might want to use a union, enum, or object and the relative strengths and weaknesses of each feature, and see why unions and objects should be the backbone of most TypeScript projects.

  • How Serverless Saved Money on My Heating Bill

    I built a serverless application as a weekend project to help me save money on my heating bill. In doing so, I experienced something great about building websites in 2022.

  • Everything You Need To Know About TypeScript Union Types

    Union types are a powerful feature of TypeScript to ergonomically model a finite number of mutually exclusive cases and ensure that every case is handled safely.

  • TypeScript Type Guards Explained

    Type guards are conditional checks that allow types to be narrowed from general types to more specific ones. With type guards, we do run-time type checking and ensure that code is safe.

  • How to Power Up the React Context API with TypeScript

    Context is a simple, but powerful feature that can be used in any React project. Using Context we can solve issues with prop drilling, and then by adding TypeScript, we can dramatically improve safety when using a context.

  • Why I'm Not Worried About GitHub Copilot Taking My Software Job

    Tools like Copilot are extremely powerful natural language interfaces for writing code, but there are very real limitations to it, as well as legal and ethical issues. Ultimately, it is a tool for developers, not a replacement for a developer.

  • How to Delete Dead Code in TypeScript Projects

    Deleting dead code is a worthwhile effort that reduces the amount of that code that has to be downloaded, compiled, and maintained. Using automated tools, we can simplify the process of identifying dead code and removing it.

  • parseFloat vs Number: What's the Difference?

    Picking a function to use for parsing numbers can be a confusing question to answer, so let's take a look at what exactly are the differences and similarities between these two functions.

  • Generating Social Images with Remix

    Social images are a great way to enhance your website's online presence and Remix makes dynamically generating images for your website much simpler compared to other React frameworks.

  • Performing Surgery on Types with Modify

    The Modify type can be used to replace properties in types, which can be useful when working with libraries that have non-generic types.

  • Essential Tools for Production-Ready React Apps

    In this post, we'll look at the tools and technologies that I would recommend based on my personal experience for building feature packed, maintainable, and production-ready React apps.