Back to Browse

Stop using so many optionals… Simple typescript trick

24.2K views
Dec 1, 2023
6:44

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: https://twitter.com/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

Download

0 formats

No download links available.

Stop using so many optionals… Simple typescript trick | NatokHD