A simple TypeScript pattern to conditionally include types. Useful for frontend development where you are managing state such as React props.
Discriminating unions are a simple concept that once you learn, you will use everywhere.
-----
Twitter: / jollyshopland
Personal Site: https://jamesshopland.com
GitHub: https://github.com/jolbol1
JollyUI: https://jollycod.ing/ui
Where I Work: https://jollycod.ing/work
-----
0:00 Introduction
0:12 The Problem
1:40 Discriminated Unions
3:00 React Component
5:35 Props Example
6:30 Outro