ts constructor props type code example
Example 1: ts react props type
type Props = {
size: string;
}
const Component = ({ size = 'medium' }: Props) => (
<div className={cn('spinner', size)} />
);
Example 2: get typescript props of component
type ViewProps = React.ComponentProps<typeof View>
// or
type InputProps = React.ComponentProps<'input'>