Represents the type of a function component. Can optionally receive a type argument that represents the props the component receives.
The props the component accepts.
React TypeScript Cheatsheet
for FunctionComponent
// With props:type Props = { name: string }const MyComponent: FC<Props> = (props) => { return <div>{props.name}</div>} Copy
// With props:type Props = { name: string }const MyComponent: FC<Props> = (props) => { return <div>{props.name}</div>}
// Without props:const MyComponentWithoutProps: FC = () => { return <div>MyComponentWithoutProps</div>} Copy
// Without props:const MyComponentWithoutProps: FC = () => { return <div>MyComponentWithoutProps</div>}
Represents the type of a function component. Can optionally receive a type argument that represents the props the component receives.