# How to write a React Component in TypeScript

DevFeed: [How to write a React Component in TypeScript](<https://devfeed.tech/articles/how-to-write-a-react-component-in-typescript-51801.md>)

Original publisher: [Read original article](<https://kentcdodds.com/blog/how-to-write-a-react-component-in-typescript>)

Published: 2021-03-04T00:00:00Z

Content type: tutorial

Language: en

Sources: [Kent C. Dodds Blog](<https://devfeed.tech/sources/kent-c-dodds-blog.md>)

Topics: [React](<https://devfeed.tech/topics/react.md>), [TypeScript](<https://devfeed.tech/topics/typescript.md>), [function](<https://devfeed.tech/topics/function.md>), [generic programming](<https://devfeed.tech/topics/generic-programming.md>)

Tags: [how-to](<https://devfeed.tech/tags/how-to.md>), [react](<https://devfeed.tech/tags/react.md>), [react-component](<https://devfeed.tech/tags/react-component.md>), [typescript](<https://devfeed.tech/tags/typescript.md>)

## AI overview

A tutorial explains how to type React components in TypeScript. It recommends treating components as functions, typing their props and return values directly, and avoiding approaches with notable limitations.

## Source excerpt

There are plenty of ways to do it, here's how I recommend typing React Components