---
title: "Discussion on \"The Magic of keyof and typeof in Typescript\" | Hashnode"
description: "Discussion on \"The Magic of keyof and typeof in Typescript\". Ever get stuck writing out long unions for component props based on an object? There's a cleaner way!\nThis post explores using keyof and typeof to automatically generate type unions from object keys for your React components.\nThe Problem:\nLet's say y..."
url: "https://hashnode.com/posts/the-magic-of-keyof-and-typeof-in-typescript/6633bcebdf65bf557a6af61f"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [The Magic of keyof and typeof in Typescript](https://anjan.hashnode.dev/the-magic-of-keyof-and-typeof-in-typescript?utm_source=hashnode&utm_medium=feed)

Ever get stuck writing out long unions for component props based on an object? There's a cleaner way! This post explores using keyof and typeof to automatically generate type unions from object keys for your React components. The Problem: Let's say y...

May 2, 2024 · 2 min read · anjan.hashnode.dev  
Read the article

-   [#typescript](https://hashnode.com/tag/typescript)
-   [#reactjs](https://hashnode.com/tag/reactjs)
-   [#tips](https://hashnode.com/tag/tips)
-   [#web-development](https://hashnode.com/tag/web-development)
-   [#frontend-development](https://hashnode.com/tag/frontend-development)
-   [#javascript](https://hashnode.com/tag/javascript)

## Written by

[Anjan (Joshua)](https://hashnode.com/@anjankarmakar)

@anjankarmakar · Bangladesh

  
[View profile](https://hashnode.com/@anjankarmakar)

Love to gather knowledge

Hello there! 👋 I'm Anjan, a self-taught Front-End Developer with a knack for crafting intuitive and visually captivating web applications. While my journey into tech didn't start with a traditional computer science background, my unbridled passion for technology has guided me to where I am today. I take immense pride in the progress I've made. Front-end development has captured my heart, and I find joy in every line of code that brings designs to life.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
