Course contentsShow
← React
Lesson 2392 of 2,39651. TypeScript with React BasicsFree lesson

The Case For React.FC

When React.FC helps: namespace properties (Button.Group), displayName, and consistency in large teams.

The Case For React.FC

You'll learn: When React.FC actually provides meaningful value in TypeScript codebases.

While the previous lesson outlined the drawbacks of React.FC, it's not universally bad. There are legitimate scenarios where it shines, particularly in large-scale applications with specific architectural needs.

Where React.FC Helps

Namespace Properties

React.FC works beautifully with compound components that use namespace properties:

const Button: React.FC<ButtonProps> & { Group: React.FC } = (props) => {
  return <button {...props} />;
};

Button.Group = (props) => {
  return <div className="button-group">{props.children}</div>;
};

// Usage
<Button.Group>
  <Button>Click me</Button>
</Button.Group>

Without React.FC, you'd need verbose type assertions to make this pattern work cleanly.

DisplayName for Debugging

React.FC automatically sets displayName based on the variable name, improving React DevTools readability. In large component libraries where debugging is frequent, this consistency matters:

const UserProfile: React.FC<UserProps> = (props) => {
  // DevTools shows "UserProfile" automatically
  return <div>{props.name}</div>;
};

Team Consistency

In large organizations with mixed-experience developers, React.FC enforces a single, predictable pattern. Everyone knows what to expect, reducing code review friction and onboarding time. The automatic children typing (even if sometimes problematic) means fewer "why doesn't children work?" questions from junior developers.

The Balanced View

Think of React.FC like training wheels: helpful when learning or when consistency matters more than perfect ergonomics. Advanced teams working on performance-critical code might avoid it, but teams prioritizing developer experience and consistency often embrace it.

Key Takeaway: Use React.FC when building compound components, maintaining large codebases with many contributors, or when consistent DevTools naming matters more than micro-optimizations—skip it for maximum type safety and flexibility.