Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan Now×
Skip to content
World desk3 min

React Functional Component Type: Type Props, Returns, Children, and Refs

Type a React function component’s props directly, usually let its return type be inferred, and choose children and ref types with your project’s React and TypeScript versions in mind.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

In TypeScript, a React function component is usually a function with a typed props parameter and an inferred return type. For most components, define the props contract and let the project’s JSX and React types check the returned JSX:

interface GreetingProps {
  name: string;
}

function Greeting({ name }: GreetingProps) {
  return <h1>Hello, {name}!</h1>;
}

“Component type” can mean either the props a component accepts or the callable function itself. When writing a component, you generally need to type its props—not add a broad component type annotation. React’s TypeScript guide demonstrates direct props typing.

Type the props parameter first

A function component receives one props object as its first argument. Type that object inline for a small, one-off component, or give it a name when the contract has several fields, is reused, or benefits from a clear public API. React’s TypeScript guide demonstrates both approaches.

type ButtonProps = {
  title: string;
  disabled: boolean;
};

function Button({ title, disabled }: ButtonProps) {
  return <button disabled={disabled}>{title}</button>;
}

Annotate the parameter before destructuring its fields. This makes the component’s accepted props explicit and lets TypeScript check uses such as <Button title="Save" disabled={false} />.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Inline type or named type?

  • Inline object type: suitable for a short prop list used only once.
  • Named interface or type alias: easier to read and reuse when props grow or form a public component contract.

Neither syntax is mandatory. Choose the form that makes the contract clearest.

Let ordinary return types be inferred

For a typical component that returns JSX, TypeScript can infer the return type from the implementation. An explicit return annotation is not generally required just because the function is a React component.

The exact return types accepted as JSX components depend on the TypeScript, React, and React type-definition versions in the project. The TypeScript JSX handbook explains that JSX checks function components and that TypeScript 5.1 introduced JSX.ElementType, which allows JSX component eligibility to be customized by the relevant type definitions.

If you are publishing a component library or enforcing a specific public API boundary, an explicit return type may be useful. Check it against the versions your project supports rather than assuming one annotation works across every React and TypeScript setup.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Choose a children type based on what you accept

Use React.ReactNode when a prop should accept general renderable content, such as text, numbers, or JSX. Use React.ReactElement when the API specifically requires an element object rather than any renderable value. React’s TypeScript guide distinguishes these types.

interface ModalProps {
  title: string;
  children: React.ReactNode;
}

function Modal({ title, children }: ModalProps) {
  return (
    <section>
      <h2>{title}</h2>
      {children}
    </section>
  );
}

Do not use React.ReactElement merely because a value appears between a component’s opening and closing tags: it is narrower than React.ReactNode and excludes values such as strings and numbers. TypeScript also cannot express a general restriction that children must be a particular HTML tag type, such as only <li> elements.

React.FC is optional, not a requirement

React.FC (also called React.FunctionComponent) is one way to describe a component function, but it is not required for ordinary function components. Directly typing the props parameter is the straightforward pattern shown in React’s official guide; the function’s return type can usually remain inferred.

The useful distinction is what you are typing: the props contract, the component function, or its return value. For routine component implementation, a named props type plus inference is typically enough. For a reusable library or other explicit API boundary, make a deliberate choice based on the installed type definitions and supported versions.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

In React 19, ref can be a function-component prop

React’s React 19 announcement says that function components can access ref as a prop starting in React 19, and that new function components no longer need forwardRef. This is version-dependent: verify that the React and @types/react versions installed in your project support the pattern before using it, especially in a project on an earlier release. React’s version page listed React 19.3 as the latest version when accessed on October 4, 2026.

Render components through JSX

TypeScript typing does not change React’s runtime rule: render a component through JSX rather than calling it as an ordinary function. React needs to control when component functions run during rendering. The React documentation states, “Components should only be used in JSX. Don’t call them as regular functions.” See React calls Components and Hooks.

// Render as a component
<Greeting name="Ada" />;

// Do not invoke the component directly
Greeting({ name: "Ada" });

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.