typescript react proptype code example
Example 1: prop-types
npm install --save prop-types
Example 2: ts react props type
type Props = {
size: string;
}
const Component = ({ size = 'medium' }: Props) => (
<div className={cn('spinner', size)} />
);