Here are three ways to define a React component in TypeScript which, in the end, are three ways to define a function in TypeScript—React components are JavaScript functions.
const MyComponent = (text: string) => <>{text}</>
const MyComponent = (text: string) => {
return (
<>{text}</>
)
}
function MyComponent(text: string) {
return <>{text}</>
}