--

No thanks ☺️ By far my most common use of string union types is to pass a constrained set of Tailwind CSS as classes into a component, such as "mb-4" | "mb-0", and an enum hides that information. If I have to click through to look up what the enum values are, then that slows down my development process.

--

--

Dr. Derek Austin 🥳
Dr. Derek Austin 🥳

Written by Dr. Derek Austin 🥳

Hi, I'm Doctor Derek! I've been a professional web developer since 2005, and I love writing about programming with JavaScript, TypeScript, React, Next.js & Git.

No responses yet