Represents the type of a function component. Can optionally receive a type argument that represents the props the component receives.

Type Parameters

  • P = {}

    The props the component accepts.

See

React TypeScript Cheatsheet

Alias

for FunctionComponent

Example

// With props:
type Props = { name: string }

const MyComponent: FC<Props> = (props) => {
return <div>{props.name}</div>
}

Example

// Without props:
const MyComponentWithoutProps: FC = () => {
return <div>MyComponentWithoutProps</div>
}