Typing Function Components with FC vs Plain Functions
What you'll learn: You'll understand the trade-offs between React's FC (FunctionComponent) type and plain function signatures for typing components, and when to use each approach.
React components in TypeScript can be typed two ways: using the React.FC helper type or writing plain function signatures. Both compile to the same runtime code, but they differ in what TypeScript enforces at compile time.
The React.FC Approach
React.FC<Props> is a generic type that wraps your component, automatically including children and return type checking:
import React from 'react';
type ButtonProps = {
label: string;
onClick: () => void;
};
const Button: React.FC<ButtonProps> = ({ label, onClick }) => {
return <button onClick={onClick}>{label}</button>;
};
This approach automatically adds children?: React.ReactNode to your props (in older React versions), enforces the return type is a valid React element, and clearly signals "this is a React component."
The Plain Function Approach
You can type components as regular functions that return JSX:
type ButtonProps = {
label: string;
onClick: () => void;
};
function Button({ label, onClick }: ButtonProps): React.ReactElement {
return <button onClick={onClick}>{label}</button>;
}
This gives you full control over whether children exists (you must explicitly add it to props if needed), works exactly like other TypeScript functions, and avoids the FC wrapper layer.
When to Choose Which
Modern React development favors plain functions because they're more explicit about children (preventing accidental usage), simpler (fewer magic types), and align with standard TypeScript patterns. Use React.FC only if your team prefers it for consistency or if you specifically want the built-in children handling.
Key Takeaway: Plain function signatures offer more control and explicitness for typing React components, while React.FC provides convenience at the cost of hiding children behavior—modern practice favors the explicit plain function approach.