Get the prop type of a React component or element
20 June 2025 (Updated 20 June 2025)
Get the props of a custom component:
type Props = React.ComponentProps<typeof MyCustomComponent>
Get the props of a built-in HTML element:
type Props = React.ComponentProps<'table'>
Tagged:
React recipes