A credit union client asked me last month to move its member dashboard from JavaScript to TypeScript. The first question from their junior developer was simple: which type does a component get?
Most answers online still say React.FC or JSX.Element, and both bite you in React 19. JSX.Element no longer exists as a global, and React.FC dropped implicit children back in version 18.
Quick answer: type the props object, not the component. Write function Card({ owner }: CardProps), let TypeScript infer the return type, use ReactNode for children and ComponentProps<"button"> to extend HTML props.
type CardProps = { owner: string; balance: number };
function Card({ owner, balance }: CardProps) {
return <li>{owner}: ${balance.toFixed(2)}</li>;
}
In this tutorial, I’ll walk through React component types in TypeScript on one real dashboard: props, children, HTML props, generics, events, React.FC and the errors each mistake gives you.
The Sample: A Typed Account Dashboard in App.tsx
Everything below comes from one file, src/App.tsx, in a Vite project on React 19.3, @types/react 19.3, Vite 8.3 and TypeScript 7.0.2. If you need a project first, follow this React app setup with Vite.
import { useState } from "react";
import type { ChangeEvent, ComponentProps, ReactNode } from "react";
type Status = "active" | "frozen";
type Member = { id: number; owner: string; balance: number; status?: Status };
type AccountCardProps = Omit<Member, "id">;
function AccountCard({ owner, balance, status = "active" }: AccountCardProps) {
const usd = balance.toLocaleString("en-US", { style: "currency", currency: "USD" });
return <li className={status}>{owner}: {usd} ({status})</li>;
}
type PanelProps = { title: string; children: ReactNode };
function Panel({ title, children }: PanelProps) {
return (
<section>
<h2>{title}</h2>
{children}
</section>
);
}
type ButtonProps = ComponentProps<"button"> & { variant?: "primary" | "ghost" };
function Button({ variant = "primary", ...rest }: ButtonProps) {
return <button className={variant} {...rest} />;
}
type ListProps<T> = { items: T[]; render: (item: T) => ReactNode };
function List<T>({ items, render }: ListProps<T>) {
return <ul>{items.map(render)}</ul>;
}
const MEMBERS: Member[] = [
{ id: 1, owner: "Dana Whitfield", balance: 2480.5 },
{ id: 2, owner: "Marcus Reyes", balance: 915.25, status: "frozen" },
{ id: 3, owner: "Erin Gallagher", balance: 12040 },
];
export default function App() {
const [query, setQuery] = useState("");
const [total, setTotal] = useState<number | null>(null);
const shown = MEMBERS.filter((m) =>
m.owner.toLowerCase().includes(query.toLowerCase()));
function handleChange(e: ChangeEvent<HTMLInputElement>) {
setQuery(e.target.value);
setTotal(null);
}
return (
<Panel title="Summit Ridge Credit Union: Accounts">
<input id="q" placeholder="Filter by name" value={query}
onChange={handleChange} />
<List items={shown} render={(m) => (
<AccountCard key={m.id} owner={m.owner} balance={m.balance}
status={m.status} />
)} />
<Button id="sum" onClick={() =>
setTotal(shown.reduce((s, m) => s + m.balance, 0))}>
Show total
</Button>
{total !== null && <p id="total">Total: ${total.toFixed(2)}</p>}
</Panel>
);
}
Browser console after typing r and clicking Show total:
2 cards, Total: $12955.25
Here’s the result after I typed “r” in the filter box and clicked Show total:

Dana Whitfield has no “r”, so two cards stay and the total is $12,955.25. Marcus Reyes shows as frozen because his record sets status.

How Do You Type a Function Component’s Props?
Give the props object a type and annotate the destructured parameter. AccountCard reuses Member with Omit<Member, "id">, so the card can’t drift from the data.
status? makes the prop optional, and status = "active" fills it in. That default parameter replaces defaultProps, which React 19 ignores on function components (more in optional props in React).
type or interface both work for props; I use type because unions like Status need it anyway. Here’s how type and interface differ.
What Return Type Should a React Component Have?
Usually none. TypeScript infers it from the JSX, and the inferred type is React.JSX.Element. A hand-written return type only gets in your way once the component returns null.
If a lint rule forces an annotation, import it. The global JSX namespace is gone in @types/react 19, so the old spelling fails:
function Alert({ children }: { children: JSX.Element }) {
return <div role="alert">{children}</div>;
}
export const a = <Alert><strong>Overdue</strong></Alert>;
error TS2503: Cannot find namespace 'JSX'.
The fix is import type { JSX } from "react" or writing React.JSX.Element.
Typing children: ReactNode vs JSX.Element vs PropsWithChildren
Panel types children as ReactNode, which accepts elements, strings, numbers, arrays, null and undefined. That’s what you want for wrappers; React components with children covers more patterns.
JSX.Element is much narrower. With the import fixed, the element child passes, but plain text doesn’t:
import type { JSX } from "react";
function Alert({ children }: { children: JSX.Element }) {
return <div role="alert">{children}</div>;
}
export const a = <Alert><strong>Overdue</strong></Alert>;
export const b = <Alert>Overdue</Alert>;
error TS2747: 'Alert' components don't accept text as child elements. Text in JSX has the type 'string', but the expected type of 'children' is 'Element'.
PropsWithChildren<{ title: string }> adds an optional children?: ReactNode for you. Write it out yourself when you want children required.
Extending HTML Element Props with ComponentProps
Button wraps a real <button>, so it should accept onClick, disabled, type and the rest. ComponentProps<"button"> hands you all of them, and the spread passes them through.
In React 19, ref is a regular prop, so this wrapper needs no forwardRef. The same Button took a ref and type-checked cleanly:
import { useRef } from "react";
import type { ComponentProps } from "react";
type ButtonProps = ComponentProps<"button"> & { variant?: "primary" | "ghost" };
function Button({ variant = "primary", ...rest }: ButtonProps) {
return <button className={variant} {...rest} />;
}
export function Toolbar() {
const ref = useRef<HTMLButtonElement>(null);
return <Button ref={ref} onClick={() => ref.current?.blur()}>Export</Button>;
}
Use ComponentProps<typeof Card> to read another component’s props, which helps when you’re passing a component as a prop.
Generic Components with Type Parameters
List<T> infers T from items, so render knows each item is a Member. A typo in a field name fails at compile time:
import type { ReactNode } from "react";
type ListProps<T> = { items: T[]; render: (item: T) => ReactNode };
function List<T>({ items, render }: ListProps<T>) {
return <ul>{items.map(render)}</ul>;
}
const rows = [{ id: 1, owner: "Dana Whitfield" }];
export const ok = <List items={rows} render={(m) => <li>{m.owner}</li>} />;
export const bad = <List items={rows} render={(m) => <li>{m.name}</li>} />;
error TS2339: Property 'name' does not exist on type '{ id: number; owner: string; }'.
Generics are the main reason I skip React.FC: an arrow typed as FC<Props> can’t take its own type parameter. There’s a longer walk-through of a reusable generic React component.
How to Type React Event Handlers and useState
handleChange takes ChangeEvent<HTMLInputElement>, so e.target.value is a string. You don’t annotate inline handlers like the Button’s onClick; they get their event type from context.
useState("") infers string. total starts as null, so it needs useState<number | null>(null). Context follows the same idea; see useContext in TypeScript.
Is React.FC Still Okay in React 19?
It works, but it adds little. FC doesn’t include children, can’t be generic, and defaultProps isn’t even on its type anymore. Passing a child to an FC without a children prop fails:
import type { FC } from "react";
type BadgeProps = { label: string };
const Badge: FC<BadgeProps> = ({ label }) => <span>{label}</span>;
export const ok = <Badge label="Frozen" />;
export const bad = <Badge label="Frozen">Marcus Reyes</Badge>;
error TS2322: Type '{ label: string; children: string; }' is not assignable to type 'IntrinsicAttributes & BadgeProps'.
Property 'children' does not exist on type 'IntrinsicAttributes & BadgeProps'.

And the old default-props habit is rejected too:
error TS2339: Property 'defaultProps' does not exist on type 'FC<BadgeProps>'.
For class components, the type goes on the class: class Card extends Component<CardProps, CardState>. Here’s more on class components with props.
Common React Component Type Errors and Fixes
You’ll hit a missing required prop most often. I removed balance from the AccountCard call in the dashboard:
error TS2741: Property 'balance' is missing in type '{ key: number; owner: string; status: Status | undefined; }' but required in type 'AccountCardProps'.

| Error | Cause | Fix |
|---|---|---|
| TS2741 | Required prop not passed | Pass it, or mark it ? with a default |
| TS2322 (children) | FC or props type lacks children | Add children: ReactNode |
| TS2747 | Text passed where JSX.Element is expected | Type children as ReactNode |
| TS2503 | Global JSX namespace used | import type { JSX } from "react" |
| TS2339 (defaultProps) | defaultProps on a function component | Use default parameter values |
Moving an older JavaScript file? Fix these one at a time with this guide to convert a React component to TypeScript.
Keep going with these React guides:
- Mount a React component to a div with createRoot
- Build a React drag and drop component
- Set default props in React components
- Pass props to child components in React
Frequently Asked Questions
Should I use React.FC or a plain function in TypeScript?
A plain function with typed props. It supports generics, and FC no longer adds children for you.
What is the type of a React component’s children?
ReactNode. It accepts elements, text, numbers, arrays, null and undefined.
What’s the difference between JSX.Element and ReactNode?
JSX.Element is one element only; ReactNode is anything React can render.
Why does TypeScript say it cannot find namespace JSX?
@types/react 19 removed the global JSX. Import it with import type { JSX } from "react".
How do I type props for a component that wraps a button?
Use ComponentProps<"button"> plus your own props. In React 19 it already includes ref.
Where are React’s TypeScript types documented?
The React TypeScript guide covers props, hooks and the common types from @types/react.

Bijay Kumar is a 13-time Microsoft MVP with more than 18 years in software development, and the founder of Python Guides and TSinfo Technologies. He started out building .NET and SharePoint solutions at HP, TCS and KPIT before moving into Python, machine learning and AI, and he also builds web apps with TypeScript and React. He writes the tutorials here himself, and every example is run before publishing so you see the real output. More about Bijay · Microsoft MVP profile · LinkedIn