TypeScript Tips

Write better TypeScript code with these tips ✨

keyof typeof magic - Don't repeat yourself

keyof typeof allows you to easily create a type from the properites in an existing object

Use unknown instead of any, it's safer

The `any` type turns off type checks, but the unknown type doesn't

Use literal types to narrow your types

keyof typeof allows you to easily create a type from the properites in an existing object