Cory House
banner
housecor.com
Cory House
@housecor.com
How I handled React state over 10 years:

2014: Class state
2016: Redux
2018: useState, useReducer, useContext
2020: React query
2021: Zustand for globals
2024: useOptimistic, useTransition, useFormStatus, useActionState, RSC
2025: Tanstack DB or sync engine (Zero, Electric, Convex)
September 3, 2025 at 12:53 PM
TypeScript syntax is often inspired by JavaScript.

In some cases, TS even uses the exact same syntax as JS for a different purpose.

The difference?
JS features focus on values.
TS features focus on types.

Here's a few examples.
June 2, 2025 at 4:32 PM
Are TypeScript types worth testing?

Sometimes.

Here's when, and how.

www.youtube.com/shorts/Uv7r-...
Should I test my TypeScript types? #coding #programming
YouTube video by Cory House
www.youtube.com
May 30, 2025 at 5:12 PM
Problem: I want to enforce a string format at compile time.

Solution: Use a template literal type.

Full "TypeScript: Deep Dive" course: dometrain.com/course/deep-...
May 29, 2025 at 1:53 PM
Problem: I want to ensure my switch statement handles all potential cases.

Solution: Use TypeScript's never type.

Here's how:

Full course: dometrain.com/course/deep-...
May 28, 2025 at 11:31 AM
Problem: You have complex logic for narrowing a TypeScript type that you'd like to reuse in a few spots.

Solution: Consider an assertion function.

20% off the full course: dometrain.com/course/deep-...
May 24, 2025 at 5:29 PM
It’s live!

“TypeScript: Deep Dive” explores advanced TS concepts:

- Utility types
- Generics
- Mapped types
- Conditional types
- Template literal types
- Runtime validation
- Decorators
- tsconfig techniques

And over 250+ examples!

Get 20% off at launch here: dometrain.com/course/deep-...
May 23, 2025 at 12:31 PM
LLMs are handy when working with the command line.

I wanted a count of all the exercise files in my new course.

ChatGPT provided the correct Bash command immediately.
May 22, 2025 at 3:18 PM
It’s done!

I’ve been heads down for 3 months creating my most ambitious course yet:

“TypeScript: Deep Dive”

Just recorded the final clip. This course is 7 hours of advanced features, tips, patterns, and tricks to level up your TS skills.

Publishing this week on Dometrain!
May 21, 2025 at 3:03 PM
When migrating a codebase from JS to TS, there are two schools of thought:

1. Start strict, and loosen in spots as needed.
2. Start loose, and migrate to stricter rules over time.

I prefer 1. It's safer.

Default strict. Loosen when necessary.
May 18, 2025 at 4:03 PM
Just realized Vitest now has built in support for testing TypeScript types.

How? It includes expect-type now by default. Handy.

Example:
May 13, 2025 at 4:15 PM
Vibe coding is the modern version of copy/pasting code you don’t understand from Stack Overflow.

It seems fine at first, but at some point you need to understand how to code.
May 8, 2025 at 10:28 PM
Problem: Some interfaces like dates, times, localStorage, the URL, and the file system are “globals” that may change at any time. This makes it difficult to set up complex edge cases and hampers testing.

Solution: Instead of coding against these APIs directly, wrap access in an interface.
May 5, 2025 at 2:04 PM
Problem:
When I correct an LLM it “forgets” and makes the mistake again later.

Solution:
1. Create a llm-learning file.

2. Tell the LLM to write to that file each time I correct it. (I use copilot-instruction.md to instruct Copilot)

Now it “learns” over time!
May 2, 2025 at 12:54 PM
I validate all my runtime inputs:

-Cookies
-Local storage
-URL params
-API responses
-Form values
-Environment variables

I use Zod to validate runtime inputs. So, I don’t need to worry if the input is malformed.

I show how I work with Zod in detail in TypeScript: Deep Dive”.

Publishing in May!
April 19, 2025 at 1:36 PM
Claim: "Those who can't do, teach".

Reality: "To go deeper, teach."

For example, I've worked successfully in TypeScript for years. But now that I'm writing a deep dive course, I'm finding edge cases that I hadn't naturally explored as a practitioner.

Teaching forces me to grow.
April 17, 2025 at 7:55 PM
I'm reviewing a TypeScript codebase that's filled with type assertions like this.

return fieldErrors as { [key: string]: { errors: string[] } }

Type assertions are NOT safe.

It's saying "Trust me TypeScript, it's fine."

Instead, validate. Consider Zod, ArkType, etc.
April 17, 2025 at 7:43 PM
There are many JS runtimes - Node, Deno, Bun, etc.

Just learned about a new one: Bare.

Bare is unique:

- Light (runs on mobile)

- No server (great for P2P apps)

- Not tied to a specific JS engine.

- Separate modules (Upgrade modules when desired. Install what you need)

More: bare.pears.com
April 13, 2025 at 12:42 PM
“We don’t have time to write tests” isn’t a valid excuse anymore.

I'm presenting "Creating Automated Tests with AI" April 23 at 11AM ET.

In this webinar I'll show how to quickly generate tests using ChatGPT, Copilot, and Applitools Autonomous.

Sign up: applitools.info/8y6
Creating Automated Tests with AI | April 23 • 11 AM ET
Learn how to use GitHub Copilot, ChatGPT, and Applitools Autonomous to generate reliable automated tests—fast. In this session with Cory House, discover modern AI-driven workflows for Playwright, Vite...
applitools.info
April 10, 2025 at 1:43 PM
TypeScript has around 20 utility types.

There are 100's of handy 3rd-party utility types too.

Here are the top 4 I found while researching "TypeScript: Deep Dive" (publishing soon).

github.com/millsp/ts-to...

github.com/piotrwitek/u...

github.com/andnp/Simply...

github.com/sindresorhus...
April 8, 2025 at 1:54 PM
React Server Components have gotten a lot of hate recently.

I'm not saying they're perfect, but this short comparison shows why I still think they're compelling.

youtu.be/LdFPUzkaiCA
Why React Server Components? WAY less code.
YouTube video by Cory House
youtu.be
April 2, 2025 at 4:01 PM
I've heard people say "spelling mistakes in code are harmless".

I disagree. Spelling mistakes slow reading, create confusion, and can lead to bugs.

Solution: Run cspell as part of your CI process.

Here's an example cspell just found - a misspelled style that wasn't applying.
March 28, 2025 at 3:47 PM
PSA 📢: This isn’t error handling.

.catch((e) => console.log(e))

It's error swallowing.

The user isn’t watching the console.

Solution: Show the user a friendly non-technical message like "Sorry, an error occurred. Please try again later."
March 27, 2025 at 3:26 PM
TypeScript radically improved my frontend code.

Here are 7 reasons I use TypeScript instead of JavaScript.

youtube.com/shorts/fQaC0...
7 Reasons I Use TypeScript instead of JavaScript #coding #programming
YouTube video by Cory House
youtube.com
March 26, 2025 at 2:26 PM
Problem: Unused npm dependencies.

They make package.json harder to read, bloat node_modules, waste our time updating packages we don’t use, and create confusion about what our project requires.

Solution: npx depcheck

It lists unused dependencies.
March 25, 2025 at 4:31 PM